openzoo 0.20.0 → 0.20.2
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/bin/openzoo.js +4 -2
- package/lib/cursorcfg.js +17 -1
- package/lib/setup.js +15 -1
- package/package.json +1 -1
package/bin/openzoo.js
CHANGED
|
@@ -6,8 +6,10 @@ const HELP = `openzoo — local x402-paying proxy + MCP server for openzoo.fun
|
|
|
6
6
|
usage:
|
|
7
7
|
npx openzoo start the proxy: http://localhost:8402/v1 (keyless) PLUS a
|
|
8
8
|
public HTTPS url for cloud IDEs (key required, printed at start)
|
|
9
|
-
npx openzoo cursor [
|
|
10
|
-
|
|
9
|
+
npx openzoo cursor [dir] start proxy+tunnel, write MCP config + every model
|
|
10
|
+
into the picker, and LAUNCH Cursor on [dir]
|
|
11
|
+
(defaults to the current directory; ~ works;
|
|
12
|
+
a missing dir is created)
|
|
11
13
|
--profile use an isolated editor profile the
|
|
12
14
|
vendor account cannot re-sync over
|
|
13
15
|
npx openzoo vscode [path] same, for VS Code
|
package/lib/cursorcfg.js
CHANGED
|
@@ -204,6 +204,20 @@ export function pinEditorProviderConfig(which, { baseUrl, models }) {
|
|
|
204
204
|
if (!fs.existsSync(db)) return null;
|
|
205
205
|
const esc = (v) => String(v).replace(/'/g, "''");
|
|
206
206
|
const modelJson = esc(JSON.stringify(models.map((m) => ({ name: m, defaultOn: true, supportsAgent: true }))));
|
|
207
|
+
// The UI list must be pinned TOO. Pinning only availableAPIKeyModels meant
|
|
208
|
+
// the editor could wipe availableDefaultModels2 — the list the Models pane
|
|
209
|
+
// actually renders — and nothing put it back: measured, 413 entries in the
|
|
210
|
+
// API list and 0 in the UI, i.e. the models vanished from the picker in real
|
|
211
|
+
// time while the config still claimed they were there.
|
|
212
|
+
const uiJson = esc(JSON.stringify(models.map((m) => ({
|
|
213
|
+
name: m, defaultOn: true, supportsAgent: true, degradationStatus: 0,
|
|
214
|
+
supportsThinking: true, supportsImages: true, supportsMaxMode: true,
|
|
215
|
+
supportsNonMaxMode: true, serverModelName: m,
|
|
216
|
+
isRecommendedForBackgroundComposer: false, supportsPlanMode: true,
|
|
217
|
+
supportsSandboxing: true, isUserAdded: true, inputboxShortModelName: m,
|
|
218
|
+
parameterDefinitions: [], variants: [], legacySlugs: [], idAliases: [],
|
|
219
|
+
namedModelSectionIndex: 1, cloudAgentEffortModes: [], modelPickerBadges: [],
|
|
220
|
+
}))));
|
|
207
221
|
const primary = esc(models[0]);
|
|
208
222
|
const base = esc(baseUrl);
|
|
209
223
|
const sql = `
|
|
@@ -211,13 +225,15 @@ DROP TRIGGER IF EXISTS openzoo_pin;
|
|
|
211
225
|
CREATE TRIGGER openzoo_pin AFTER UPDATE ON ItemTable
|
|
212
226
|
WHEN NEW.key = '${KEY}'
|
|
213
227
|
AND (json_extract(NEW.value,'$.openAIBaseUrl') IS NOT '${base}'
|
|
214
|
-
OR json_extract(NEW.value,'$.featureModelConfigs.composer.defaultModel') IS NOT '${primary}'
|
|
228
|
+
OR json_extract(NEW.value,'$.featureModelConfigs.composer.defaultModel') IS NOT '${primary}'
|
|
229
|
+
OR json_array_length(json_extract(NEW.value,'$.availableDefaultModels2')) IS NOT ${models.length})
|
|
215
230
|
BEGIN
|
|
216
231
|
UPDATE ItemTable SET value = json_set(
|
|
217
232
|
NEW.value,
|
|
218
233
|
'$.openAIBaseUrl', '${base}',
|
|
219
234
|
'$.useOpenAIKey', json('true'),
|
|
220
235
|
'$.availableAPIKeyModels', json('${modelJson}'),
|
|
236
|
+
'$.availableDefaultModels2', json('${uiJson}'),
|
|
221
237
|
'$.featureModelConfigs.composer.defaultModel', '${primary}',
|
|
222
238
|
'$.featureModelConfigs.cmdK.defaultModel', '${primary}'
|
|
223
239
|
) WHERE key = NEW.key;
|
package/lib/setup.js
CHANGED
|
@@ -251,7 +251,21 @@ export async function setupEditor(which, target) {
|
|
|
251
251
|
// Open the directory you ran this from, or the one you named. The earlier
|
|
252
252
|
// "helpfully" substitute a ~/openzoo folder when run from $HOME was worse
|
|
253
253
|
// than the problem it dodged: it silently opened the wrong project.
|
|
254
|
-
|
|
254
|
+
// WORKSPACE: `openzoo cursor ~/somedir` opens that directory. Resolve it
|
|
255
|
+
// ourselves — a quoted `~` never reaches the shell's expansion, and a path
|
|
256
|
+
// that does not exist yet should be created rather than silently opening the
|
|
257
|
+
// wrong folder (the editor treats a missing path as a file and opens blank).
|
|
258
|
+
let cwd = process.cwd();
|
|
259
|
+
if (target && !target.startsWith('-')) {
|
|
260
|
+
cwd = target.startsWith('~')
|
|
261
|
+
? path.join(os.homedir(), target.slice(1))
|
|
262
|
+
: path.resolve(target);
|
|
263
|
+
if (!fs.existsSync(cwd)) {
|
|
264
|
+
fs.mkdirSync(cwd, { recursive: true });
|
|
265
|
+
console.log(`workspace: created ${cwd}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
console.log(`workspace: ${cwd}`);
|
|
255
269
|
|
|
256
270
|
const picked = pickEditor(which);
|
|
257
271
|
if (!picked) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.2",
|
|
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",
|