openzoo 0.18.2 → 0.18.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.
package/lib/cursorcfg.js CHANGED
@@ -113,6 +113,19 @@ export function writeEditorProviderConfig(which, { baseUrl, models }) {
113
113
  }
114
114
  doc.availableAPIKeyModels = existing;
115
115
 
116
+ // SELECT it, don't just offer it. Adding a model to the picker leaves the
117
+ // editor on whatever it had — `featureModelConfigs.composer.defaultModel`
118
+ // was "default", i.e. Cursor's Auto router, which chooses ITS OWN models
119
+ // (observed: Grok 4.6 preselected) and never reaches the zoo. Point the
120
+ // agent/composer surfaces at our model and clear the fallbacks, or Auto
121
+ // silently routes around us on the first hiccup.
122
+ const primary = models[0];
123
+ const fmc = (doc.featureModelConfigs && typeof doc.featureModelConfigs === 'object') ? doc.featureModelConfigs : {};
124
+ for (const surface of ['composer', 'cmdK', 'backgroundComposer']) {
125
+ fmc[surface] = { ...(fmc[surface] || {}), defaultModel: primary, fallbackModels: [], bestOfNDefaultModels: [] };
126
+ }
127
+ doc.featureModelConfigs = fmc;
128
+
116
129
  // Single-quote escaping for the SQL literal.
117
130
  const json = JSON.stringify(doc).replace(/'/g, "''");
118
131
  sqlite(db, `UPDATE ItemTable SET value='${json}' WHERE key='${KEY}';`);
@@ -130,6 +143,7 @@ export function writeEditorProviderConfig(which, { baseUrl, models }) {
130
143
  verified = {
131
144
  openAIBaseUrl: doc2.openAIBaseUrl,
132
145
  models: (doc2.availableAPIKeyModels || []).map((m) => (typeof m === 'string' ? m : m?.name)).filter(Boolean),
146
+ selected: doc2.featureModelConfigs?.composer?.defaultModel ?? null,
133
147
  };
134
148
  } catch { /* verification is advisory */ }
135
149
  const modelsStick = models.every((m) => verified.models.includes(m));
package/lib/setup.js CHANGED
@@ -183,21 +183,21 @@ export async function setupEditor(which, target) {
183
183
  } else if (wrote) {
184
184
  console.log(`settings: openAIBaseUrl -> ${wrote.verified?.openAIBaseUrl || base}`);
185
185
  console.log(' useOpenAIKey -> true');
186
- if (wrote.modelsStick) {
187
- console.log(` models -> ${models.join(', ')}`);
188
- console.log(' pick one in the model dropdown; built-ins bypass the zoo.');
189
- } else {
190
- // Cursor re-syncs this list from its account on launch, so a local write
191
- // does not survive. Say so instead of promising a dropdown entry that
192
- // will not be there.
193
- console.log(' models -> NOT writable (Cursor re-syncs this list on launch)');
194
- console.log('');
195
- console.log(' ONE-TIME manual step, in Cursor Settings → Models:');
196
- console.log(` + Add model -> ${models[0]}`);
197
- console.log(' then toggle OFF the built-in models, or Cursor keeps using its own backend.');
198
- console.log(' (the base URL + key above are already set for you and DO persist)');
199
- }
200
- }
186
+ // Cursor syncs availableAPIKeyModels + featureModelConfigs from its ACCOUNT
187
+ // on every launch and overwrites whatever is on disk — measured: written
188
+ // and verified while closed (modelsStick true, selected set), then [] and
189
+ // "default" again after relaunch. Only openAIBaseUrl survives. So we no
190
+ // longer pretend the model was configured; the base URL is done for you and
191
+ // the model is a genuine one-time UI action.
192
+ console.log('');
193
+ console.log(` DONE for you: base URL -> ${base}, key -> sk-openzoo`);
194
+ console.log(' ONE-TIME (Cursor syncs models from your account, so this cannot be scripted):');
195
+ console.log(' Settings -> Models -> + Add model');
196
+ console.log(` ${models[0]}`);
197
+ console.log(' then select it in the chat model dropdown.');
198
+ console.log(' Built-in models and "Auto" route to Cursor\'s backend, never here.');
199
+ console.log(' Verify it worked: send one message and watch this terminal for a');
200
+ console.log(' "paid $0.0… · rail solana · tx …" line. No line = it did not route.');
201
201
 
202
202
  // 3. LAUNCH with that env. Editor resolved platform-agnostically; Cursor
203
203
  // wins when both are installed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.18.2",
3
+ "version": "0.18.4",
4
4
  "description": "Local x402-paying proxy + MCP server for openzoo.fun — point any OpenAI-compatible harness (Cursor, Claude Code, aider, SDKs) at localhost and it pays per call from a local burner wallet. Solana and Base rails live; Robinhood experimental.",
5
5
  "license": "MIT",
6
6
  "type": "module",