robot-resources 1.11.0 → 1.11.1
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 +53 -51
- package/lib/non-oc-wizard.js +7 -4
- package/lib/tool-config.js +2 -2
- package/lib/wizard.js +26 -21
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,88 +1,90 @@
|
|
|
1
|
-
#
|
|
1
|
+
# robot-resources
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
Two products for any software that makes LLM API calls — chatbots, RAG pipelines, AI-powered apps, agent runtimes. Both run locally, both free.
|
|
6
|
-
|
|
7
|
-
**Router** — Intelligent LLM routing proxy. Classifies each prompt by task type, routes to the cheapest model that qualifies. 60-90% cost savings with zero quality loss.
|
|
8
|
-
|
|
9
|
-
**Scraper** — Token compression for web content. Fetches any URL, strips noise, returns clean markdown. Median 91% token reduction.
|
|
10
|
-
|
|
11
|
-
## Install
|
|
3
|
+
> One command to install Robot Resources tools for any agent stack.
|
|
12
4
|
|
|
13
5
|
```bash
|
|
14
6
|
npx robot-resources
|
|
15
7
|
```
|
|
16
8
|
|
|
17
|
-
|
|
9
|
+
The wizard detects what you're building and walks you through the right setup — OpenClaw plugin install, JS library path, Python SDK path, MCP config for Cursor / Claude Code, or just the docs URL.
|
|
18
10
|
|
|
19
|
-
## What
|
|
11
|
+
## What the wizard does
|
|
20
12
|
|
|
21
|
-
1. **
|
|
22
|
-
2. **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
1. **Provisions an anonymous API key** via `POST /v1/auth/signup` (saved to `~/.robot-resources/config.json`). Optional — routing works without it; the key just lights up the dashboard at robotresources.ai/dashboard.
|
|
14
|
+
2. **Detects your stack**:
|
|
15
|
+
- OpenClaw installed (`~/.openclaw/`) → installs the router plugin (in-process HTTP server) + scraper OC plugin, patches `openclaw.json`, restarts the gateway. **No Python, no daemon, no system service.**
|
|
16
|
+
- Non-OC + cwd has `package.json` with LangChain/LangGraph/Mastra → preselects "JS/TS agent."
|
|
17
|
+
- Non-OC + cwd has `requirements.txt` / `pyproject.toml` → preselects "Python agent."
|
|
18
|
+
- Non-OC + Cursor or Claude Code installed → preselects "MCP tool."
|
|
19
|
+
3. **Runs the chosen path**:
|
|
20
|
+
- **JS/TS agent** → prints `npm install @robot-resources/router` + `import { routePrompt }` example
|
|
21
|
+
- **Python agent** → prints `pip install robot-resources` + `from robot_resources.router import route` example, plus an httpx fallback if you'd rather skip the SDK
|
|
22
|
+
- **Cursor / Claude Code** → writes the scraper MCP config into `~/.cursor/mcp.json` / `~/.claude/settings.json`
|
|
23
|
+
- **Docs** → prints the URL + exits
|
|
24
|
+
- **Install OpenClaw first** → redirect message + exits
|
|
26
25
|
|
|
27
|
-
##
|
|
26
|
+
## Flags
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
```
|
|
29
|
+
--for=<target> langchain | python | cursor | claude-code | docs
|
|
30
|
+
Skip the prompt and run that path directly.
|
|
31
|
+
Required for non-TTY contexts (CI, piped, etc.)
|
|
32
|
+
--non-interactive Treat as CI run regardless of TTY state
|
|
33
|
+
--yes / -y Same as --non-interactive
|
|
34
|
+
```
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
Without flags in a non-TTY context, the wizard prints the `--for=` hint and exits cleanly — never blocks waiting for stdin.
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
## Pre-set the API key
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
- Content-aware token estimation
|
|
43
|
-
- 3-tier fetch: fast, stealth (TLS fingerprint), render (headless browser)
|
|
44
|
-
- Multi-page BFS crawl with robots.txt compliance
|
|
45
|
-
- Median 91% token reduction per page
|
|
40
|
+
For fleets or CI:
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
```bash
|
|
43
|
+
export RR_API_KEY=rr_live_... # skip signup, use this key
|
|
44
|
+
npx robot-resources --for=cursor # or whatever path applies
|
|
45
|
+
```
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|-------|-------------|--------|
|
|
51
|
-
| **OpenClaw** | Plugin (auto-install) | Verified |
|
|
52
|
-
| **Claude Code** | MCP server | Verified |
|
|
53
|
-
| **Any OpenAI client** | HTTP proxy (localhost:3838) | Compatible |
|
|
54
|
-
| **Cursor** | MCP server | Compatible |
|
|
55
|
-
| **Windsurf** | MCP server | Compatible |
|
|
47
|
+
## Five paths, one wizard
|
|
56
48
|
|
|
57
|
-
|
|
49
|
+
| Path | What you get | Where |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| OpenClaw plugin | In-process router inside the OC gateway. Auto-routes Anthropic calls to the cheapest capable model. | `~/.openclaw/extensions/robot-resources-router/` |
|
|
52
|
+
| JS/TS agent | `@robot-resources/router/routing` — pure ESM, zero deps, offline keyword classifier. | npm |
|
|
53
|
+
| Python agent | `robot-resources` (singular) — thin httpx client over `/v1/route`. | PyPI |
|
|
54
|
+
| HTTP API | Any language with curl/fetch. Authed by API key. | `POST https://api.robotresources.ai/v1/route` |
|
|
55
|
+
| Cursor / Claude Code MCP | Scraper MCP wired into your tool's config (web fetches → 91% smaller markdown). | `~/.cursor/mcp.json` or `~/.claude/settings.json` |
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
npx -y @robot-resources/scraper-mcp # Scraper compression
|
|
61
|
-
```
|
|
57
|
+
Full integration docs: https://robotresources.ai/docs
|
|
62
58
|
|
|
63
|
-
##
|
|
59
|
+
## Architecture (post-PR-2.5)
|
|
64
60
|
|
|
65
|
-
|
|
61
|
+
The router used to be a Python daemon on `localhost:3838`. **Not anymore.** It now runs in-process inside whichever surface consumes it:
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
- **OpenClaw** — the plugin's `register()` starts an HTTP server on `127.0.0.1:18790` inside OC's node process. Lifetime tied to OC. Zero daemon to keep alive.
|
|
64
|
+
- **JS agents** — call `routePrompt()` directly. No HTTP at all. Pure function.
|
|
65
|
+
- **Python / curl** — call `POST /v1/route` on `api.robotresources.ai`. Server-side classifier on Cloudflare Workers.
|
|
68
66
|
|
|
69
|
-
|
|
67
|
+
User provider keys never leave the user's machine. The platform never receives, stores, or transmits them.
|
|
70
68
|
|
|
71
69
|
## Telemetry
|
|
72
70
|
|
|
73
|
-
Anonymous
|
|
71
|
+
Anonymous, fire-and-forget, opt-in via the wizard's API-key provisioning. Events: `wizard_started`, `wizard_path_chosen`, `install_complete`, `route_completed`, `route_via_api`, `route_via_lib`. No personal data, no request content, no provider keys.
|
|
74
72
|
|
|
75
|
-
|
|
73
|
+
## Pricing
|
|
74
|
+
|
|
75
|
+
Free. Unlimited. Your API keys never leave your machine.
|
|
76
76
|
|
|
77
77
|
## Links
|
|
78
78
|
|
|
79
79
|
- Website: https://robotresources.ai
|
|
80
|
+
- Docs: https://robotresources.ai/docs
|
|
80
81
|
- Dashboard: https://robotresources.ai/dashboard
|
|
81
|
-
-
|
|
82
|
+
- HTTP API: `POST https://api.robotresources.ai/v1/route`
|
|
82
83
|
- npm: https://www.npmjs.com/package/robot-resources
|
|
83
84
|
- GitHub: https://github.com/robot-resources/packages
|
|
84
85
|
- Discord: https://robotresources.ai/discord
|
|
85
86
|
- Contact: agent@robotresources.ai
|
|
87
|
+
- Agent docs: https://robotresources.ai/llms.txt
|
|
86
88
|
|
|
87
89
|
## License
|
|
88
90
|
|
package/lib/non-oc-wizard.js
CHANGED
|
@@ -108,14 +108,17 @@ function showPythonPath() {
|
|
|
108
108
|
success('Python integration');
|
|
109
109
|
blank();
|
|
110
110
|
info('Install:');
|
|
111
|
-
info(' pip install robot-resources
|
|
111
|
+
info(' pip install robot-resources');
|
|
112
112
|
blank();
|
|
113
113
|
info('Use:');
|
|
114
|
-
info(' from
|
|
114
|
+
info(' from robot_resources.router import route');
|
|
115
115
|
info(' decision = route(\'write a python function\')');
|
|
116
116
|
info(' print(decision[\'selected_model\']) # e.g. \'claude-haiku-4-5\'');
|
|
117
117
|
blank();
|
|
118
|
-
info('
|
|
118
|
+
info('Prefer no SDK? POST directly to https://api.robotresources.ai/v1/route');
|
|
119
|
+
info('with httpx / requests / any HTTP client. See docs.');
|
|
120
|
+
blank();
|
|
121
|
+
info('Full docs: https://robotresources.ai/docs/crewai');
|
|
119
122
|
blank();
|
|
120
123
|
}
|
|
121
124
|
|
|
@@ -156,7 +159,7 @@ function showDocsPath() {
|
|
|
156
159
|
blank();
|
|
157
160
|
info('Integration guides: https://robotresources.ai/docs');
|
|
158
161
|
info('HTTP API: https://robotresources.ai/docs/http-api');
|
|
159
|
-
info('GitHub: https://github.com/robot-resources/
|
|
162
|
+
info('GitHub: https://github.com/robot-resources/packages');
|
|
160
163
|
blank();
|
|
161
164
|
}
|
|
162
165
|
|
package/lib/tool-config.js
CHANGED
|
@@ -301,7 +301,7 @@ function configureOpenClaw() {
|
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
instructions.push('Docs: https://github.com/robot-resources/
|
|
304
|
+
instructions.push('Docs: https://github.com/robot-resources/packages');
|
|
305
305
|
|
|
306
306
|
return {
|
|
307
307
|
name: 'OpenClaw',
|
|
@@ -339,7 +339,7 @@ function printManualInstructions() {
|
|
|
339
339
|
' # OpenAI(base_url="http://localhost:3838/v1")',
|
|
340
340
|
' # model = "gemini-2.5-flash"',
|
|
341
341
|
'',
|
|
342
|
-
'Docs: https://github.com/robot-resources/
|
|
342
|
+
'Docs: https://github.com/robot-resources/packages',
|
|
343
343
|
],
|
|
344
344
|
};
|
|
345
345
|
}
|
package/lib/wizard.js
CHANGED
|
@@ -45,24 +45,17 @@ const CLI_VERSION = (() => {
|
|
|
45
45
|
export async function runWizard({ nonInteractive = false, target = null } = {}) {
|
|
46
46
|
header();
|
|
47
47
|
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
// get the print-and-exit hint with the supported --for= options.
|
|
53
|
-
// Pre-PR-8 this was a 17-line print-and-exit; PR 8 made it interactive.
|
|
54
|
-
if (!isOpenClawInstalled()) {
|
|
55
|
-
await runNonOcWizard({ nonInteractive, target });
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
48
|
+
// Detect OC once up front. Used both to branch into the non-OC wizard and
|
|
49
|
+
// to tag the wizard_started payload, so the funnel can be segmented OC vs
|
|
50
|
+
// non-OC without a second event type.
|
|
51
|
+
const openclawDetected = isOpenClawInstalled();
|
|
59
52
|
const wizardStartMs = Date.now();
|
|
60
53
|
|
|
61
54
|
const results = {
|
|
62
55
|
auth: false,
|
|
63
56
|
authMethod: null, // 'config' | 'apikey' | 'auto'
|
|
64
57
|
pluginInstalled: false,
|
|
65
|
-
openclawDetected
|
|
58
|
+
openclawDetected,
|
|
66
59
|
openclawConfigPatched: false,
|
|
67
60
|
scraperMcpRegistered: false,
|
|
68
61
|
scraper: false,
|
|
@@ -70,9 +63,11 @@ export async function runWizard({ nonInteractive = false, target = null } = {})
|
|
|
70
63
|
|
|
71
64
|
// ── Step 0: Provision API key (before anything else) ────────────────────
|
|
72
65
|
//
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
66
|
+
// Runs for BOTH the OC and non-OC paths. Provisioning before the non-OC
|
|
67
|
+
// hand-off closes the funnel blind spot where every non-OpenClaw install
|
|
68
|
+
// was invisible to telemetry (no api_keys row, no wizard_started, no
|
|
69
|
+
// agent_signup_meta). If the session dies later, telemetry still works
|
|
70
|
+
// for all tools. Single fetch() with 10s timeout — no prompts, no browser.
|
|
76
71
|
|
|
77
72
|
{
|
|
78
73
|
const config = readConfig();
|
|
@@ -116,10 +111,11 @@ export async function runWizard({ nonInteractive = false, target = null } = {})
|
|
|
116
111
|
|
|
117
112
|
// ── Funnel marker: wizard_started ───────────────────────────────────────
|
|
118
113
|
//
|
|
119
|
-
// Sent immediately after auth
|
|
120
|
-
// point even if
|
|
121
|
-
//
|
|
122
|
-
//
|
|
114
|
+
// Sent immediately after auth, before either path branches, so we have
|
|
115
|
+
// proof the wizard reached this point even if a later step crashes. Pairs
|
|
116
|
+
// with install_complete (OC path) or wizard_path_chosen (non-OC path) to
|
|
117
|
+
// give us a "started → done" funnel. The openclaw_detected field lets us
|
|
118
|
+
// segment OC vs non-OC funnels without a second event type.
|
|
123
119
|
//
|
|
124
120
|
// Timeout asymmetry vs install_complete (5s, no retry vs 10s × 2 attempts):
|
|
125
121
|
// wizard_started is a best-effort funnel marker — losing it just means we
|
|
@@ -144,6 +140,7 @@ export async function runWizard({ nonInteractive = false, target = null } = {})
|
|
|
144
140
|
cli_version: CLI_VERSION,
|
|
145
141
|
auth_method: results.authMethod,
|
|
146
142
|
non_interactive: nonInteractive,
|
|
143
|
+
openclaw_detected: openclawDetected,
|
|
147
144
|
},
|
|
148
145
|
}),
|
|
149
146
|
signal: AbortSignal.timeout(5_000),
|
|
@@ -153,6 +150,15 @@ export async function runWizard({ nonInteractive = false, target = null } = {})
|
|
|
153
150
|
}
|
|
154
151
|
}
|
|
155
152
|
|
|
153
|
+
// Non-OC branch. Hands off to the multi-agent compatibility wizard which
|
|
154
|
+
// routes the user to the right install path (npm install / pip install /
|
|
155
|
+
// MCP config / docs / install-OC). The non-OC wizard's wizard_path_chosen
|
|
156
|
+
// telemetry now fires too, since Step 0 above provisioned an api_key.
|
|
157
|
+
if (!openclawDetected) {
|
|
158
|
+
await runNonOcWizard({ nonInteractive, target });
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
156
162
|
// ── Step 1: Tool Routing Configuration ──────────────────────────────────
|
|
157
163
|
//
|
|
158
164
|
// Installs the OC plugin (which is @robot-resources/router — the router
|
|
@@ -166,7 +172,6 @@ export async function runWizard({ nonInteractive = false, target = null } = {})
|
|
|
166
172
|
const toolResults = configureToolRouting();
|
|
167
173
|
results.tools = toolResults;
|
|
168
174
|
|
|
169
|
-
results.openclawDetected = isOpenClawInstalled();
|
|
170
175
|
const ocResult = toolResults.find((r) => r.name === 'OpenClaw');
|
|
171
176
|
if (ocResult) {
|
|
172
177
|
results.pluginInstalled =
|
|
@@ -384,7 +389,7 @@ export async function runWizard({ nonInteractive = false, target = null } = {})
|
|
|
384
389
|
// Telegram survives this restart. If the session dies here, the agent
|
|
385
390
|
// picks up on the next message with all tools loaded.
|
|
386
391
|
|
|
387
|
-
if (
|
|
392
|
+
if (openclawDetected && (results.tools?.some(r => r.action === 'installed') || scraperRegistered)) {
|
|
388
393
|
try {
|
|
389
394
|
await restartOpenClawGateway();
|
|
390
395
|
success('OpenClaw gateway restarted');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "robot-resources",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.1",
|
|
4
4
|
"description": "Robot Resources — AI agent tools. One command to install everything.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://robotresources.ai",
|
|
48
48
|
"bugs": {
|
|
49
|
-
"url": "https://github.com/robot-resources/
|
|
49
|
+
"url": "https://github.com/robot-resources/packages/issues"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|