raysurfer 0.5.1 → 0.5.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 +21 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,10 +40,16 @@ for await (const message of query({
|
|
|
40
40
|
}
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
All Claude SDK types are re-exported from `raysurfer`, so you don't need a
|
|
43
|
+
All Claude SDK types are re-exported from `raysurfer`, so you don't need a
|
|
44
|
+
separate import:
|
|
44
45
|
|
|
45
46
|
```typescript
|
|
46
|
-
import {
|
|
47
|
+
import {
|
|
48
|
+
query,
|
|
49
|
+
type Options,
|
|
50
|
+
type SDKMessage,
|
|
51
|
+
type Query,
|
|
52
|
+
} from "raysurfer";
|
|
47
53
|
```
|
|
48
54
|
|
|
49
55
|
## How It Works
|
|
@@ -52,7 +58,8 @@ import { query, type Options, type SDKMessage, type Query } from "raysurfer";
|
|
|
52
58
|
2. **Injects into prompt**: Agent sees proven code snippets
|
|
53
59
|
3. **After success**: New code is cached for next time
|
|
54
60
|
|
|
55
|
-
Caching is enabled automatically when `RAYSURFER_API_KEY` is set. Without it,
|
|
61
|
+
Caching is enabled automatically when `RAYSURFER_API_KEY` is set. Without it,
|
|
62
|
+
behaves exactly like the original SDK.
|
|
56
63
|
|
|
57
64
|
## Class-based API
|
|
58
65
|
|
|
@@ -122,11 +129,11 @@ const enterpriseClient = new ClaudeSDKClient({
|
|
|
122
129
|
});
|
|
123
130
|
```
|
|
124
131
|
|
|
125
|
-
| Configuration
|
|
126
|
-
|
|
127
|
-
| Default (public only)
|
|
128
|
-
| `snipsDesired: "company"`
|
|
129
|
-
| `snipsDesired: "client"`
|
|
132
|
+
| Configuration | Required Tier |
|
|
133
|
+
|------------------------------|---------------------|
|
|
134
|
+
| Default (public only) | FREE |
|
|
135
|
+
| `snipsDesired: "company"` | TEAM or ENTERPRISE |
|
|
136
|
+
| `snipsDesired: "client"` | ENTERPRISE only |
|
|
130
137
|
|
|
131
138
|
## Low-Level API
|
|
132
139
|
|
|
@@ -138,13 +145,17 @@ import { RaySurfer } from "raysurfer";
|
|
|
138
145
|
const client = new RaySurfer({ apiKey: "your_api_key" });
|
|
139
146
|
|
|
140
147
|
// 1. Get cached code snippets for a task
|
|
141
|
-
const snips = await client.getCodeSnips({
|
|
148
|
+
const snips = await client.getCodeSnips({
|
|
149
|
+
task: "Fetch GitHub trending repos",
|
|
150
|
+
});
|
|
142
151
|
for (const match of snips.codeBlocks) {
|
|
143
152
|
console.log(`${match.codeBlock.name}: ${match.score}`);
|
|
144
153
|
}
|
|
145
154
|
|
|
146
155
|
// Or use the unified search endpoint
|
|
147
|
-
const searchResult = await client.search({
|
|
156
|
+
const searchResult = await client.search({
|
|
157
|
+
task: "Fetch GitHub trending repos",
|
|
158
|
+
});
|
|
148
159
|
for (const match of searchResult.matches) {
|
|
149
160
|
console.log(`${match.codeBlock.name}: ${match.combinedScore}`);
|
|
150
161
|
}
|