raysurfer 0.6.2 → 0.7.0
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 +60 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
[Website](https://raysurfer.com) · [Docs](https://docs.raysurfer.com) · [Dashboard](https://raysurfer.com/dashboard/api-keys)
|
|
4
4
|
|
|
5
5
|
<!-- Old: LLM output caching for AI agents. Retrieve proven code instead of regenerating it. -->
|
|
6
|
-
Code reputation layer for AI agents. Let agents re-use generated
|
|
7
|
-
|
|
6
|
+
<!-- Old: Code reputation layer for AI agents. Let agents re-use generated code vs running 30 serial tools or generating code per execution. -->
|
|
7
|
+
AI Maintained Skills for Vertical Agents. Re-use verified code
|
|
8
|
+
from prior runs rather than serial tool calls or generating code
|
|
9
|
+
per execution.
|
|
8
10
|
|
|
9
11
|
## Installation
|
|
10
12
|
|
|
@@ -353,6 +355,62 @@ const client = new ClaudeSDKClient({ publicSnips: true });
|
|
|
353
355
|
const rs = new RaySurfer({ apiKey: "...", publicSnips: true });
|
|
354
356
|
```
|
|
355
357
|
|
|
358
|
+
## Programmatic Tool Calling
|
|
359
|
+
|
|
360
|
+
Register local tools and let the server generate + execute code
|
|
361
|
+
that calls them:
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
import { RaySurfer } from "raysurfer";
|
|
365
|
+
|
|
366
|
+
const rs = new RaySurfer({ apiKey: "your_api_key" });
|
|
367
|
+
|
|
368
|
+
rs.tool("add", "Add two numbers together", { a: "integer", b: "integer" },
|
|
369
|
+
async (args) => String(Number(args.a) + Number(args.b))
|
|
370
|
+
);
|
|
371
|
+
|
|
372
|
+
rs.tool("multiply", "Multiply two numbers together", { a: "integer", b: "integer" },
|
|
373
|
+
async (args) => String(Number(args.a) * Number(args.b))
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
const result = await rs.execute(
|
|
377
|
+
"Add 5 and 3, then multiply the result by 2"
|
|
378
|
+
);
|
|
379
|
+
console.log(result.result); // "16"
|
|
380
|
+
console.log(result.toolCalls); // [{toolName: 'add', ...}, ...]
|
|
381
|
+
console.log(result.cacheHit); // true on subsequent runs
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### How It Works
|
|
385
|
+
|
|
386
|
+
1. SDK connects a WebSocket to the server for tool call routing
|
|
387
|
+
2. Server generates Python code (or reuses reference code from a
|
|
388
|
+
similar prior run)
|
|
389
|
+
3. Code runs in a sandboxed environment — tool calls are routed
|
|
390
|
+
back to your local functions via WebSocket
|
|
391
|
+
4. Results are returned with full tool call history
|
|
392
|
+
|
|
393
|
+
### Execute Options
|
|
394
|
+
|
|
395
|
+
```typescript
|
|
396
|
+
const result = await rs.execute("Your task description", {
|
|
397
|
+
timeout: 300000, // Max time in ms (default 300000)
|
|
398
|
+
forceRegenerate: false, // Skip cache (default false)
|
|
399
|
+
});
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### ExecuteResult Fields
|
|
403
|
+
|
|
404
|
+
| Field | Type | Description |
|
|
405
|
+
| ------------- | ------------------ | -------------------------------- |
|
|
406
|
+
| `executionId` | `string` | Unique execution identifier |
|
|
407
|
+
| `result` | `string \| null` | Stdout output from the script |
|
|
408
|
+
| `exitCode` | `number` | Process exit code (0 = success) |
|
|
409
|
+
| `durationMs` | `number` | Total execution time |
|
|
410
|
+
| `cacheHit` | `boolean` | Whether reference code was found |
|
|
411
|
+
| `error` | `string \| null` | Error message if exitCode != 0 |
|
|
412
|
+
| `toolCalls` | `ToolCallRecord[]` | All tool calls made |
|
|
413
|
+
|
|
356
414
|
## License
|
|
357
415
|
|
|
358
416
|
MIT
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "raysurfer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"_description_old": "Semantic code caching for LLM agents",
|
|
5
|
-
"
|
|
5
|
+
"_description_old2": "Code reputation layer for AI agents",
|
|
6
|
+
"description": "AI maintained skills for vertical agents",
|
|
6
7
|
"type": "module",
|
|
7
8
|
"main": "./dist/index.js",
|
|
8
9
|
"module": "./dist/index.js",
|