@r-33/opencode 0.4.7-rc.29 → 0.4.7-rc.31

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
@@ -45,14 +45,32 @@ the connect completes, the wizard takes over automatically:
45
45
  2. The budget picker follows in OpenCode — your organisations come
46
46
  first when you belong to several (budgets never mix organisations),
47
47
  then that organisation's projects or your personal key.
48
- 3. The route_33 models appear. Pick one and prompt away.
48
+ 3. Key setup follows for that budget: bind one of your existing keys for
49
+ it, or create one — name, monthly cap in EUR, description, expiry, and
50
+ the models it may use (tick several, or allow all).
51
+ 4. The route_33 models appear. Pick one and prompt away — OpenCode v2
52
+ asks you to pick when no route_33 model is active yet.
53
+
54
+ The cap is checked against what the budget allows you: the question shows
55
+ the maximum when the budget sets one, and asks again for a higher amount.
56
+ Binding a key whose secret is not stored on this machine rotates it — its
57
+ other users stop working — so you are asked first. Esc on any question
58
+ cancels the setup; nothing is created.
59
+
60
+ On OpenCode v2 the setup is blocking: a waiting dialog covers the pauses
61
+ between the steps until the key exists, and a key Route 33 still refuses
62
+ shows the reason and returns to the questions with your answers kept. The
63
+ model pick switches the model inside a session; from the home screen it
64
+ ends with a pointer to `/models`.
49
65
 
50
66
  A folder that is signed in but never attributed auto-runs the budget
51
67
  picker at launch — the prompt stays locked behind a setup mode until a
52
68
  budget is assigned, with Enter resuming setup; route_33 model requests
53
- from unattributed folders are refused server-side with the same guidance
54
- where the lock is unavailable. A browser is required for every sign-in;
55
- restarts afterwards sign in silently.
69
+ from unattributed folders are refused server-side where the lock is
70
+ unavailable. A message never names both commands: it points to `/connect`
71
+ while you are signed out, and to the `/r33` menu once you are signed in. A
72
+ browser is required for every sign-in; restarts afterwards sign in
73
+ silently.
56
74
 
57
75
  ## Commands
58
76
 
@@ -64,6 +82,9 @@ restarts afterwards sign in silently.
64
82
  | `/r33 reset` | Clear the assigned budget — the wizard runs again on the next start |
65
83
  | `/r33 logout` | Sign out of Route 33 |
66
84
 
85
+ The menu's budget entry — **Attribute** on OpenCode v2, **Change budget**
86
+ on v1 — reopens the budget picker and the key setup for this folder.
87
+
67
88
  A browser is required for every sign-in; restarts afterwards sign in silently.
68
89
 
69
90
  ## Keys
@@ -74,6 +95,12 @@ folder never changes who this one bills for. Keys are short-lived and rotate
74
95
  automatically; nothing secret is ever written to your project, logs, or
75
96
  terminal.
76
97
 
98
+ ## Session cost
99
+
100
+ The cost OpenCode shows for a session on a route_33 model is an estimate
101
+ from USD list prices. Route 33 meters your budget itself, in EUR — the two
102
+ differ, and a model without a published price shows no cost.
103
+
77
104
  ## Direct key mode
78
105
 
79
106
  Set `ROUTE33_API_KEY` to a gateway key and the wizard is bypassed entirely —
@@ -90,18 +117,21 @@ export ROUTE33_API_KEY=r33_sk_...
90
117
  Connecting is always explicit — run `/connect` yourself. What auto-starts
91
118
  at OpenCode launch is the attribution wizard for folders that are signed
92
119
  in but have no budget assigned yet. Suppress that with
93
- `ROUTE33_AUTOCONNECT=0` and assign a budget manually instead — `/r33` or
94
- `/connect`. On remote or headless machines, use `ROUTE33_API_KEY` instead
95
- of the wizard.
120
+ `ROUTE33_AUTOCONNECT=0` and assign the budget from the `/r33` menu when
121
+ you choose to; on OpenCode v1 the opt-out switches the `/r33` menu off as
122
+ well. On remote or headless machines, use `ROUTE33_API_KEY` instead of the
123
+ wizard.
96
124
 
97
125
  ## Troubleshooting
98
126
 
99
- | Symptom | What to do |
100
- | --------------------------------------------- | -------------------------------------------------------------------------------- |
101
- | No route_33 models after start | `/connect` → Route 33 — the silent sign-in expired; sign in once and they return |
102
- | "This Route 33 build has no OAuth client id" | Update the plugin to a released build, or set `ROUTE33_CLIENT_ID` and restart |
103
- | "needs a Git worktree" | Open a Git repository (or `git init`) in the folder, then connect again |
104
- | Sign-in link never appears / SSH-only machine | Sign-in needs a browser on the same machine — there is no device-flow fallback |
127
+ | Symptom | What to do |
128
+ | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
129
+ | No route_33 models after start | `/connect` → Route 33 — the silent sign-in expired; sign in once and they return |
130
+ | "This Route 33 build has no OAuth client id" | Update the plugin to a released build, or set `ROUTE33_CLIENT_ID` and restart |
131
+ | "To assign a Route 33 budget, open a Git repository." | Open a Git repository (or `git init`) in the folder, then connect again |
132
+ | Sign-in link never appears / SSH-only machine | Sign-in needs a browser on the same machine — there is no device-flow fallback |
133
+ | "Route 33 — key not created" (OpenCode v2) | The dialog gives Route 33's reason, such as a cap above your allowance — change the answer and confirm again |
134
+ | "Choosing individual models needs a fresh Route 33 sign-in." | A personal budget lists its models only for a sign-in that carries the `models:read` permission; the next browser sign-in adds it |
105
135
 
106
136
  ## Configuration
107
137
 
@@ -113,3 +143,7 @@ of the wizard.
113
143
  | `ROUTE33_AUTH_ISSUER` | OAuth issuer | `https://auth.route33.ai` |
114
144
  | `ROUTE33_API_BASE` | Management API base | `https://mapi.route33.ai/api/v1` |
115
145
  | `ROUTE33_BASE_URL` | Gateway models base | `https://api.route33.ai/v1` |
146
+
147
+ A custom `ROUTE33_CLIENT_ID` must allow every scope the plugin requests —
148
+ `models:read`, which lists the models of a personal budget, among them —
149
+ or the auth server refuses the sign-in with `invalid_scope`.