robot-resources 1.8.0 → 1.8.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/lib/tool-config.js +23 -10
- package/package.json +1 -1
package/lib/tool-config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { readFileSync, writeFileSync, copyFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
3
|
+
import { readFileSync, writeFileSync, copyFileSync, cpSync, mkdirSync, existsSync, rmSync } from 'node:fs';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
import { join, dirname } from 'node:path';
|
|
6
6
|
import { isOpenClawInstalled, isOpenClawPluginInstalled, getOpenClawAuthMode, isClaudeCodeInstalled, isCursorInstalled } from './detect.js';
|
|
@@ -98,7 +98,11 @@ function registerScraperMcp() {
|
|
|
98
98
|
*
|
|
99
99
|
* The plugin ships as a CLI dependency (@robot-resources/openclaw-plugin).
|
|
100
100
|
* Instead of spawning `openclaw plugins install` (30s npm overhead),
|
|
101
|
-
* we copy
|
|
101
|
+
* we copy files directly. Same destination, same result.
|
|
102
|
+
*
|
|
103
|
+
* Since 0.5.5, the plugin is a thin shim (index.js) that imports the rest
|
|
104
|
+
* of its code from ./lib/*.js — copy the lib/ directory too, or the shim
|
|
105
|
+
* fails to load with MODULE_NOT_FOUND.
|
|
102
106
|
*/
|
|
103
107
|
function installPluginFiles() {
|
|
104
108
|
const require = createRequire(import.meta.url);
|
|
@@ -111,6 +115,15 @@ function installPluginFiles() {
|
|
|
111
115
|
for (const file of ['index.js', 'openclaw.plugin.json', 'package.json']) {
|
|
112
116
|
copyFileSync(join(pluginDir, file), join(targetDir, file));
|
|
113
117
|
}
|
|
118
|
+
|
|
119
|
+
// Copy lib/ recursively. Clear the destination first so files removed in
|
|
120
|
+
// a new version don't linger from a previous install.
|
|
121
|
+
const srcLib = join(pluginDir, 'lib');
|
|
122
|
+
const dstLib = join(targetDir, 'lib');
|
|
123
|
+
if (existsSync(srcLib)) {
|
|
124
|
+
rmSync(dstLib, { recursive: true, force: true });
|
|
125
|
+
cpSync(srcLib, dstLib, { recursive: true });
|
|
126
|
+
}
|
|
114
127
|
}
|
|
115
128
|
|
|
116
129
|
/**
|
|
@@ -219,18 +232,18 @@ function printManualInstructions() {
|
|
|
219
232
|
'No AI tools detected for auto-configuration.',
|
|
220
233
|
'Point your SDK at the Router by setting the base URL:',
|
|
221
234
|
'',
|
|
222
|
-
' # OpenAI SDK / compatible clients',
|
|
235
|
+
' # OpenAI SDK / compatible clients (include /v1 in the URL)',
|
|
223
236
|
' export OPENAI_BASE_URL=http://localhost:3838/v1',
|
|
237
|
+
' # OpenAI(base_url="http://localhost:3838/v1")',
|
|
224
238
|
'',
|
|
225
|
-
' # Anthropic SDK',
|
|
226
|
-
' export ANTHROPIC_BASE_URL=http://localhost:3838
|
|
227
|
-
'',
|
|
228
|
-
' # Google Generative AI',
|
|
229
|
-
' export GOOGLE_API_BASE=http://localhost:3838/v1',
|
|
239
|
+
' # Anthropic SDK (NO /v1 — the SDK appends /v1/messages itself)',
|
|
240
|
+
' export ANTHROPIC_BASE_URL=http://localhost:3838',
|
|
241
|
+
' # Anthropic(base_url="http://localhost:3838")',
|
|
230
242
|
'',
|
|
231
|
-
' #
|
|
243
|
+
' # Google / Gemini: native SDK is NOT supported via base_url.',
|
|
244
|
+
' # Use the OpenAI-compatible client with a Gemini model name:',
|
|
232
245
|
' # OpenAI(base_url="http://localhost:3838/v1")',
|
|
233
|
-
' #
|
|
246
|
+
' # model = "gemini-2.5-flash"',
|
|
234
247
|
'',
|
|
235
248
|
'Docs: https://github.com/robot-resources/robot-resources',
|
|
236
249
|
],
|