robot-resources 1.14.0 → 1.14.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/README.md +63 -50
- package/lib/non-oc-wizard.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,78 +1,91 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Robot Resources
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Tools for AI agents and agentic software. Humans have HR. Agents have RR.
|
|
4
|
+
|
|
5
|
+
Robot Resources builds tools for AI agents and any software that makes LLM API calls — chatbots, RAG pipelines, AI-powered apps, internal tools. Two products today: **Router** (smart model selection — picks the right model for each task, 60-90% cost savings as a side effect) and **Scraper** (token compression for web content, median 91% token reduction). Both run locally. Both free.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
4
8
|
|
|
5
9
|
```bash
|
|
6
|
-
npx robot-resources
|
|
10
|
+
npx -y robot-resources
|
|
7
11
|
```
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
Detects your project shape (Node / Python / OpenClaw) and installs the right shim. No login, no API keys to enter, no signup. Router uses your existing provider keys — they never leave your machine.
|
|
14
|
+
|
|
15
|
+
## Router
|
|
16
|
+
|
|
17
|
+
Smart model selection. Classifies each prompt by task type (coding / reasoning / analysis / simple_qa / creative / general), filters by model capability, then within the qualifying set picks the cheapest. Routes the right model for the task — cost savings (60-90% across mixed workloads) follow from that, not the other way around. Hybrid classification: keyword fast-path (~5ms, ~70% of prompts) + LLM slow-path for ambiguous prompts (~200ms). Routes across Anthropic, OpenAI, and Google when the corresponding keys are present.
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
Three ways to install on a dev machine:
|
|
12
20
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
21
|
+
- **OpenClaw users** get an in-process plugin inside the OC gateway. Anthropic, OpenAI, and Google calls each route to their native upstream — no cross-shape body translation.
|
|
22
|
+
- **Node projects** get an auto-attach shim (`NODE_OPTIONS=--require .../auto.cjs`). Every Anthropic, OpenAI, and Google SDK call from any Node process routes automatically. No code changes.
|
|
23
|
+
- **Python projects** get a `.pth` auto-attach shim in your venv. Every `anthropic` / `openai` / `google.generativeai` SDK call routes automatically. No code changes.
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
For runtimes that ignore `NODE_OPTIONS` / `.pth` (Bun, Deno, Vercel Edge, Go, Rust, etc.), call the HTTP API directly: `POST https://api.robotresources.ai/v1/route`. Authed by API key, 100 req/min, CORS open.
|
|
27
26
|
|
|
27
|
+
For explicit control inside JS / Python code, use the routing-decision library:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @robot-resources/router # JS / TS
|
|
31
|
+
pip install robot-resources # Python (singular package name)
|
|
28
32
|
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import { routePrompt } from '@robot-resources/router/routing';
|
|
36
|
+
const decision = routePrompt('write a python function that reverses a string');
|
|
37
|
+
// decision.selected_model → 'claude-haiku-4-5' (or similar — cheapest qualifying)
|
|
34
38
|
```
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
```python
|
|
41
|
+
from robot_resources.router import route
|
|
42
|
+
decision = route('write a python function that reverses a string')
|
|
43
|
+
```
|
|
37
44
|
|
|
38
|
-
|
|
45
|
+
Returns a routing decision; your code makes the actual LLM call with the selected model. Each request goes from your machine straight to the lab's API (`api.anthropic.com` / `api.openai.com` / `generativelanguage.googleapis.com`) using your existing key for that lab. Nothing is relayed through our infrastructure.
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
## Scraper
|
|
41
48
|
|
|
42
|
-
|
|
43
|
-
export RR_API_KEY=rr_live_... # skip signup, use this key
|
|
44
|
-
npx robot-resources --for=cursor # or whatever path applies
|
|
45
|
-
```
|
|
49
|
+
Token compression for web content. Fetches any URL, strips noise, returns clean markdown with token count. Median 91% token reduction per page (verified across 41 page types). Mozilla Readability extraction (0.97 F1). Content-aware token estimation calibrated per content type, ±15% of actual BPE. 3-tier fetch (fast / stealth via TLS fingerprint / render via headless browser), BFS multi-page crawl, robots.txt compliance.
|
|
46
50
|
|
|
47
|
-
|
|
51
|
+
Three ways to consume:
|
|
48
52
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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` |
|
|
53
|
+
- **JS library** — `npm install @robot-resources/scraper` → `import { scrape } from '@robot-resources/scraper'`
|
|
54
|
+
- **MCP server** — `npx -y @robot-resources/scraper scraper-mcp` exposes `scraper_compress_url(url)` and crawl tools to any MCP-compatible client. Auto-wired into OpenClaw by the wizard; for other clients (Cursor, Claude Code, Windsurf), add manually to your client's MCP config.
|
|
55
|
+
- **OpenClaw plugin** — installed automatically via `npx robot-resources`. Hooks `before_tool_call` to redirect `web_fetch` through scraper compression.
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
No API keys, no config.
|
|
58
58
|
|
|
59
|
-
##
|
|
59
|
+
## Deploying to production
|
|
60
60
|
|
|
61
|
-
The
|
|
61
|
+
The wizard's shell-config install reaches dev machines only — production processes don't read `.bashrc`, and env vars come from your deploy config. Copy-paste recipes for setting `NODE_OPTIONS` (Node) or installing the `.pth` shim (Python) on Docker, Google Cloud Run, AWS Lambda, and Vercel: https://robotresources.ai/docs/deploy/.
|
|
62
62
|
|
|
63
|
-
|
|
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.
|
|
63
|
+
## Advanced
|
|
66
64
|
|
|
67
|
-
|
|
65
|
+
```
|
|
66
|
+
npx robot-resources [flags]
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
--for=<target> langchain | python | cursor | claude-code | docs
|
|
69
|
+
Skip the prompt and run that path directly.
|
|
70
|
+
Required for non-TTY contexts (CI, piped, etc.)
|
|
71
|
+
--non-interactive Treat as CI run regardless of TTY state
|
|
72
|
+
--yes / -y Same as --non-interactive
|
|
73
|
+
```
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
Pre-set the API key for fleets or CI (skips signup, uses the key you provide):
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
export RR_API_KEY=rr_live_...
|
|
79
|
+
npx robot-resources --for=langchain
|
|
80
|
+
```
|
|
72
81
|
|
|
73
82
|
## Pricing
|
|
74
83
|
|
|
75
|
-
Free. Unlimited.
|
|
84
|
+
Free. Unlimited. No tiers. You pay your AI providers directly — no markup, no rate limits, no quotas.
|
|
85
|
+
|
|
86
|
+
## Telemetry
|
|
87
|
+
|
|
88
|
+
Anonymous usage events (model selection, cost savings, install outcome) — no personal data, no request content, no provider keys. Opt out with `RR_TELEMETRY=off`.
|
|
76
89
|
|
|
77
90
|
## Links
|
|
78
91
|
|
|
@@ -80,11 +93,11 @@ Free. Unlimited. Your API keys never leave your machine.
|
|
|
80
93
|
- Docs: https://robotresources.ai/docs
|
|
81
94
|
- Dashboard: https://robotresources.ai/dashboard
|
|
82
95
|
- HTTP API: `POST https://api.robotresources.ai/v1/route`
|
|
83
|
-
- npm: https://www.npmjs.com/package/robot-resources
|
|
84
96
|
- GitHub: https://github.com/robot-resources/packages
|
|
85
97
|
- Discord: https://robotresources.ai/discord
|
|
86
98
|
- Contact: agent@robotresources.ai
|
|
87
|
-
|
|
99
|
+
|
|
100
|
+
> AI agents installing this on a human's behalf: see https://robotresources.ai/llms.txt for the agent install protocol.
|
|
88
101
|
|
|
89
102
|
## License
|
|
90
103
|
|
package/lib/non-oc-wizard.js
CHANGED
|
@@ -106,7 +106,8 @@ async function showJsPath() {
|
|
|
106
106
|
}
|
|
107
107
|
blank();
|
|
108
108
|
info('Once your shell picks up the new NODE_OPTIONS, every Node agent on');
|
|
109
|
-
info('this machine routes Anthropic SDK calls through
|
|
109
|
+
info('this machine routes Anthropic, OpenAI, and Google SDK calls through');
|
|
110
|
+
info('Robot Resources.');
|
|
110
111
|
if (process.platform === 'win32') {
|
|
111
112
|
info('Open a new cmd / PowerShell window — current terminals will not see the change.');
|
|
112
113
|
} else {
|