robot-resources 1.7.7 → 1.7.9
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 +43 -58
- package/lib/wizard.js +67 -16
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -2,103 +2,88 @@
|
|
|
2
2
|
|
|
3
3
|
> Tools for AI agents. Humans have HR. Agents have RR.
|
|
4
4
|
|
|
5
|
-
|
|
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
6
|
|
|
7
|
-
|
|
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
|
|
8
12
|
|
|
9
13
|
```bash
|
|
10
14
|
npx robot-resources
|
|
11
15
|
```
|
|
12
16
|
|
|
13
|
-
One command:
|
|
17
|
+
One command: installs Router as an always-on system service, registers Scraper as an MCP tool, configures your agent automatically.
|
|
14
18
|
|
|
15
|
-
##
|
|
19
|
+
## What It Does
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
1. **Installs Router** — Python venv + system service on localhost:3838
|
|
22
|
+
2. **Registers Scraper** — MCP tool `scraper_compress_url(url)` in your agent
|
|
23
|
+
3. **Configures OpenClaw** — Plugin auto-installed if OpenClaw is detected
|
|
24
|
+
4. **Provisions API key** — For telemetry and dashboard access
|
|
25
|
+
5. **Health check** — Verifies everything is running after install
|
|
18
26
|
|
|
19
|
-
|
|
27
|
+
## Router
|
|
20
28
|
|
|
21
|
-
|
|
22
|
-
- Dynamic thresholds: simple tasks open cheap models (0.60), complex tasks require top models (0.85)
|
|
23
|
-
- 11 models across OpenAI, Anthropic, and Google — routes within your available providers
|
|
24
|
-
- 60-90% cost savings with zero quality loss
|
|
25
|
-
- OpenAI-compatible API on localhost:3838 — change your base_url and you're done
|
|
26
|
-
- OpenClaw compatible — plugin auto-installs, works with API keys and subscriptions
|
|
29
|
+
Transparent proxy on localhost:3838. Your LLM calls pass through, Router selects the cheapest capable model:
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
- Hybrid classification: keyword detection (~5ms) + LLM fallback (~200ms)
|
|
32
|
+
- Dynamic thresholds: simple tasks → cheap models, complex tasks → top models
|
|
33
|
+
- Models across OpenAI, Anthropic, Google — routes within your available providers
|
|
34
|
+
- Your API keys pass through via headers — never stored by Router
|
|
35
|
+
- OpenAI-compatible API — change `base_url` to `http://localhost:3838`
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
## Scraper
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
Available as MCP tool after install:
|
|
35
40
|
|
|
36
41
|
- Mozilla Readability extraction (0.97 F1 accuracy)
|
|
37
|
-
- Content-aware token estimation
|
|
42
|
+
- Content-aware token estimation
|
|
38
43
|
- 3-tier fetch: fast, stealth (TLS fingerprint), render (headless browser)
|
|
39
44
|
- Multi-page BFS crawl with robots.txt compliance
|
|
40
45
|
- Median 91% token reduction per page
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
## Agent Compatibility
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
| Agent | Integration | Status |
|
|
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 |
|
|
45
56
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### MCP Servers
|
|
49
|
-
|
|
50
|
-
Both products include MCP servers for AI agent integration:
|
|
57
|
+
## MCP Servers
|
|
51
58
|
|
|
52
59
|
```bash
|
|
53
60
|
npx -y @robot-resources/router-mcp # Router stats + config
|
|
54
61
|
npx -y @robot-resources/scraper-mcp # Scraper compression
|
|
55
62
|
```
|
|
56
63
|
|
|
57
|
-
##
|
|
58
|
-
|
|
59
|
-
Free. Unlimited. No tiers. Both tools run locally — you pay your AI providers directly. No markup, no rate limits, no quotas. Your API keys never leave your machine.
|
|
64
|
+
## Dashboard
|
|
60
65
|
|
|
61
|
-
|
|
66
|
+
Usage dashboard at https://robotresources.ai/dashboard — real-time telemetry, cost savings, routing stats. Auth via GitHub OAuth.
|
|
62
67
|
|
|
63
|
-
|
|
64
|
-
robot-resources/
|
|
65
|
-
├── router/ # LLM routing proxy (Python + TypeScript MCP)
|
|
66
|
-
├── scraper/ # Token compression (TypeScript)
|
|
67
|
-
├── web/ # Landing page + dashboard (React/Vite)
|
|
68
|
-
├── platform/ # Backend API — auth, telemetry (Hono/Cloudflare Workers)
|
|
69
|
-
├── packages/ # Unified CLI installer (npx robot-resources)
|
|
70
|
-
├── skills/ # Agent skills (ClawHub)
|
|
71
|
-
├── _orchestrator/ # Business coordination
|
|
72
|
-
└── _brand/ # Brand assets and design system
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Development
|
|
76
|
-
|
|
77
|
-
Each product has its own setup:
|
|
68
|
+
## Pricing
|
|
78
69
|
|
|
79
|
-
|
|
80
|
-
- [Scraper](./scraper/packages/scraper/README.md)
|
|
81
|
-
- [Platform](./platform/README.md)
|
|
82
|
-
- [CLI](./packages/cli/README.md)
|
|
70
|
+
Free. Unlimited. No tiers. Your API keys never leave your machine.
|
|
83
71
|
|
|
84
|
-
##
|
|
72
|
+
## Telemetry
|
|
85
73
|
|
|
86
|
-
|
|
74
|
+
Anonymous usage telemetry (model selection, cost savings) to improve the product. No personal data, no request content, no API keys.
|
|
87
75
|
|
|
88
|
-
|
|
89
|
-
- **Scraper**: tsc, vitest
|
|
90
|
-
- **Web**: tsc, eslint
|
|
91
|
-
- **Publish**: 7 npm packages via OIDC (`router`, `router-mcp`, `scraper`, `scraper-mcp`, `scraper-tracking`, `cli-core`, `cli`)
|
|
76
|
+
Opt out: `export RR_TELEMETRY=off`
|
|
92
77
|
|
|
93
78
|
## Links
|
|
94
79
|
|
|
95
80
|
- Website: https://robotresources.ai
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
81
|
+
- Dashboard: https://robotresources.ai/dashboard
|
|
82
|
+
- Agent docs: https://robotresources.ai/llms.txt
|
|
83
|
+
- npm: https://www.npmjs.com/package/robot-resources
|
|
84
|
+
- GitHub: https://github.com/robot-resources/packages
|
|
99
85
|
- Discord: https://robotresources.ai/discord
|
|
100
86
|
- Contact: agent@robotresources.ai
|
|
101
|
-
- Agent docs: https://robotresources.ai/llms.txt
|
|
102
87
|
|
|
103
88
|
## License
|
|
104
89
|
|
package/lib/wizard.js
CHANGED
|
@@ -77,6 +77,44 @@ export async function runWizard({ nonInteractive = false } = {}) {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
// ── Funnel marker: wizard_started ───────────────────────────────────────
|
|
81
|
+
//
|
|
82
|
+
// Sent immediately after auth so we have proof the wizard reached this
|
|
83
|
+
// point even if any install step crashes. Pairs with install_complete at
|
|
84
|
+
// the end to give us a "started → completed" funnel for diagnosing silent
|
|
85
|
+
// signups. Fire-and-forget — never fatal.
|
|
86
|
+
//
|
|
87
|
+
// Timeout asymmetry vs install_complete (5s, no retry vs 10s × 2 attempts):
|
|
88
|
+
// wizard_started is a best-effort funnel marker — losing it just means we
|
|
89
|
+
// miss one funnel datapoint. install_complete is a heartbeat that powers
|
|
90
|
+
// last_used_at and the "wizard ran successfully" signal, so it gets the
|
|
91
|
+
// longer timeout + retry to maximize delivery.
|
|
92
|
+
|
|
93
|
+
if (results.auth) {
|
|
94
|
+
try {
|
|
95
|
+
const config = readConfig();
|
|
96
|
+
const platformUrl = process.env.RR_PLATFORM_URL || 'https://api.robotresources.ai';
|
|
97
|
+
await fetch(`${platformUrl}/v1/telemetry`, {
|
|
98
|
+
method: 'POST',
|
|
99
|
+
headers: {
|
|
100
|
+
'Authorization': `Bearer ${config.api_key}`,
|
|
101
|
+
'Content-Type': 'application/json',
|
|
102
|
+
},
|
|
103
|
+
body: JSON.stringify({
|
|
104
|
+
product: 'cli',
|
|
105
|
+
event_type: 'wizard_started',
|
|
106
|
+
payload: {
|
|
107
|
+
auth_method: results.authMethod,
|
|
108
|
+
non_interactive: nonInteractive,
|
|
109
|
+
},
|
|
110
|
+
}),
|
|
111
|
+
signal: AbortSignal.timeout(5_000),
|
|
112
|
+
});
|
|
113
|
+
} catch {
|
|
114
|
+
// Non-fatal — wizard_started is best-effort
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
80
118
|
// ── Step 1: Router Installation ─────────────────────────────────────────
|
|
81
119
|
|
|
82
120
|
step('Checking Router...');
|
|
@@ -254,29 +292,42 @@ export async function runWizard({ nonInteractive = false } = {}) {
|
|
|
254
292
|
//
|
|
255
293
|
// Fire once after install, using the API key directly (not from config read-back).
|
|
256
294
|
// This immediately populates last_used_at and proves the key works end-to-end.
|
|
295
|
+
//
|
|
296
|
+
// Retry once with longer timeout — Cloudflare analytics showed client-side
|
|
297
|
+
// aborts on the original 5s single-attempt, leaving stranded signups with
|
|
298
|
+
// no telemetry. Two 10s attempts catch the long tail. Still fire-and-forget.
|
|
257
299
|
|
|
258
300
|
if (results.auth) {
|
|
259
301
|
try {
|
|
260
302
|
const config = readConfig();
|
|
261
303
|
const platformUrl = process.env.RR_PLATFORM_URL || 'https://api.robotresources.ai';
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
304
|
+
const body = JSON.stringify({
|
|
305
|
+
product: 'cli',
|
|
306
|
+
event_type: 'install_complete',
|
|
307
|
+
payload: {
|
|
308
|
+
router: results.router || false,
|
|
309
|
+
service: results.service || false,
|
|
310
|
+
scraper: results.scraper || false,
|
|
311
|
+
source: 'wizard',
|
|
267
312
|
},
|
|
268
|
-
body: JSON.stringify({
|
|
269
|
-
product: 'cli',
|
|
270
|
-
event_type: 'install_complete',
|
|
271
|
-
payload: {
|
|
272
|
-
router: results.router || false,
|
|
273
|
-
service: results.service || false,
|
|
274
|
-
scraper: results.scraper || false,
|
|
275
|
-
source: 'wizard',
|
|
276
|
-
},
|
|
277
|
-
}),
|
|
278
|
-
signal: AbortSignal.timeout(5_000),
|
|
279
313
|
});
|
|
314
|
+
|
|
315
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
316
|
+
try {
|
|
317
|
+
const res = await fetch(`${platformUrl}/v1/telemetry`, {
|
|
318
|
+
method: 'POST',
|
|
319
|
+
headers: {
|
|
320
|
+
'Authorization': `Bearer ${config.api_key}`,
|
|
321
|
+
'Content-Type': 'application/json',
|
|
322
|
+
},
|
|
323
|
+
body,
|
|
324
|
+
signal: AbortSignal.timeout(10_000),
|
|
325
|
+
});
|
|
326
|
+
if (res.ok) break;
|
|
327
|
+
} catch {
|
|
328
|
+
// Try again on next iteration; outer catch handles total failure
|
|
329
|
+
}
|
|
330
|
+
}
|
|
280
331
|
} catch {
|
|
281
332
|
// Non-fatal — install_complete is best-effort
|
|
282
333
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "robot-resources",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.9",
|
|
4
4
|
"description": "Robot Resources — AI agent tools. One command to install everything.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,7 +19,10 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@robot-resources/cli-core": "*",
|
|
21
21
|
"@robot-resources/openclaw-plugin": "*",
|
|
22
|
-
"@robot-resources/scraper": "^0.3.
|
|
22
|
+
"@robot-resources/scraper": "^0.3.1"
|
|
23
|
+
},
|
|
24
|
+
"optionalDependencies": {
|
|
25
|
+
"@robot-resources/router": "*"
|
|
23
26
|
},
|
|
24
27
|
"devDependencies": {
|
|
25
28
|
"vitest": "^1.2.0"
|
|
@@ -41,7 +44,7 @@
|
|
|
41
44
|
"author": "Robot Resources Team",
|
|
42
45
|
"repository": {
|
|
43
46
|
"type": "git",
|
|
44
|
-
"url": "git+https://github.com/robot-resources/
|
|
47
|
+
"url": "git+https://github.com/robot-resources/packages.git",
|
|
45
48
|
"directory": "packages/cli"
|
|
46
49
|
},
|
|
47
50
|
"homepage": "https://robotresources.ai",
|