raysurfer 0.5.10 → 0.5.12
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 +235 -62
- package/dist/client.d.ts +12 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +93 -9
- package/dist/sdk-client.d.ts +2 -0
- package/dist/sdk-client.d.ts.map +1 -1
- package/dist/types.d.ts +46 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# RaySurfer TypeScript SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
LLM output caching for AI agents. Retrieve proven code instead of
|
|
4
|
+
regenerating it.
|
|
4
5
|
|
|
5
6
|
## Installation
|
|
6
7
|
|
|
@@ -16,9 +17,221 @@ Set your API key:
|
|
|
16
17
|
export RAYSURFER_API_KEY=your_api_key_here
|
|
17
18
|
```
|
|
18
19
|
|
|
19
|
-
Get your key from the
|
|
20
|
+
Get your key from the
|
|
21
|
+
[dashboard](https://raysurfer.com/dashboard/api-keys).
|
|
20
22
|
|
|
21
|
-
##
|
|
23
|
+
## Low-Level API
|
|
24
|
+
|
|
25
|
+
For custom integrations, use the `RaySurfer` client directly with
|
|
26
|
+
any LLM provider.
|
|
27
|
+
|
|
28
|
+
### Complete Example
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { RaySurfer } from "raysurfer";
|
|
32
|
+
|
|
33
|
+
const client = new RaySurfer({ apiKey: "your_api_key" });
|
|
34
|
+
const task = "Fetch GitHub trending repos";
|
|
35
|
+
|
|
36
|
+
// 1. Retrieve cached code files for a task
|
|
37
|
+
const result = await client.getCodeFiles({
|
|
38
|
+
task,
|
|
39
|
+
topK: 5,
|
|
40
|
+
minVerdictScore: 0.3,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// result.addToLlmPrompt contains a pre-formatted string like:
|
|
44
|
+
//
|
|
45
|
+
// You have access to pre-written code files:
|
|
46
|
+
// - .raysurfer_code/github_fetcher.ts: Fetches trending repos
|
|
47
|
+
// ...
|
|
48
|
+
|
|
49
|
+
// Augment your system prompt with cached code context
|
|
50
|
+
const basePrompt = "You are a helpful coding assistant.";
|
|
51
|
+
const augmentedPrompt = basePrompt + result.addToLlmPrompt;
|
|
52
|
+
|
|
53
|
+
// Use augmentedPrompt with any LLM provider (Anthropic, OpenAI, etc.)
|
|
54
|
+
|
|
55
|
+
// 2. Upload a new code file after execution
|
|
56
|
+
await client.uploadNewCodeSnip({
|
|
57
|
+
task,
|
|
58
|
+
fileWritten: {
|
|
59
|
+
path: "fetch_repos.ts",
|
|
60
|
+
content: "function fetch() { ... }",
|
|
61
|
+
},
|
|
62
|
+
succeeded: true,
|
|
63
|
+
executionLogs: "Fetched 10 trending repos successfully",
|
|
64
|
+
dependencies: { "node-fetch": "3.3.0", zod: "3.22.0" },
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// 2b. Bulk upload prompts/logs/code for sandboxed grading
|
|
68
|
+
await client.uploadBulkCodeSnips(
|
|
69
|
+
["Build a CLI tool", "Add CSV support"],
|
|
70
|
+
[{ path: "cli.ts", content: "function main() { ... }" }],
|
|
71
|
+
[
|
|
72
|
+
{
|
|
73
|
+
path: "logs/run.log",
|
|
74
|
+
content: "Task completed",
|
|
75
|
+
encoding: "utf-8",
|
|
76
|
+
},
|
|
77
|
+
]
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
// 3. Vote on whether a cached snippet was useful
|
|
81
|
+
await client.voteCodeSnip({
|
|
82
|
+
task,
|
|
83
|
+
codeBlockId: result.files[0].codeBlockId,
|
|
84
|
+
codeBlockName: result.files[0].filename,
|
|
85
|
+
codeBlockDescription: result.files[0].description,
|
|
86
|
+
succeeded: true,
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Client Options
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
const client = new RaySurfer({
|
|
94
|
+
apiKey: "your_api_key",
|
|
95
|
+
baseUrl: "https://api.raysurfer.com", // optional
|
|
96
|
+
timeout: 30000, // optional, in ms
|
|
97
|
+
organizationId: "org_xxx", // optional, for team namespacing
|
|
98
|
+
workspaceId: "ws_xxx", // optional, for enterprise namespacing
|
|
99
|
+
snipsDesired: "company", // optional, snippet scope
|
|
100
|
+
publicSnips: true, // optional, include community snippets
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Response Fields
|
|
105
|
+
|
|
106
|
+
The `getCodeFiles()` response includes:
|
|
107
|
+
|
|
108
|
+
| Field | Type | Description |
|
|
109
|
+
| ---------------- | ------------ | --------------------------------- |
|
|
110
|
+
| `files` | `CodeFile[]` | Retrieved code files with metadata|
|
|
111
|
+
| `task` | `string` | The task that was searched |
|
|
112
|
+
| `totalFound` | `number` | Total matches found |
|
|
113
|
+
| `addToLlmPrompt` | `string` | Pre-formatted string to append to LLM system prompt |
|
|
114
|
+
|
|
115
|
+
Each `CodeFile` contains `codeBlockId`, `filename`, `source`,
|
|
116
|
+
`description`, `verdictScore`, `thumbsUp`, `thumbsDown`, and
|
|
117
|
+
`similarityScore`.
|
|
118
|
+
|
|
119
|
+
### Store a Code Block with Full Metadata
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
const result = await client.storeCodeBlock({
|
|
123
|
+
name: "GitHub User Fetcher",
|
|
124
|
+
source: "function fetchUser(username) { ... }",
|
|
125
|
+
entrypoint: "fetchUser",
|
|
126
|
+
language: "typescript",
|
|
127
|
+
description: "Fetches user data from GitHub API",
|
|
128
|
+
tags: ["github", "api", "user"],
|
|
129
|
+
dependencies: { "node-fetch": "3.3.0" },
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Retrieve Few-Shot Examples
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
const examples = await client.getFewShotExamples(
|
|
137
|
+
"Parse CSV files",
|
|
138
|
+
3
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
for (const ex of examples) {
|
|
142
|
+
console.log(`Task: ${ex.task}`);
|
|
143
|
+
console.log(`Code: ${ex.codeSnippet}`);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Retrieve Task Patterns
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
const patterns = await client.getTaskPatterns({
|
|
151
|
+
task: "API integration",
|
|
152
|
+
minThumbsUp: 5,
|
|
153
|
+
topK: 20,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
for (const p of patterns) {
|
|
157
|
+
console.log(`${p.taskPattern} -> ${p.codeBlockName}`);
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### User-Provided Votes
|
|
162
|
+
|
|
163
|
+
Instead of relying on AI voting, provide your own votes:
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
// Single upload with your own vote (AI voting is skipped)
|
|
167
|
+
await client.uploadNewCodeSnip({
|
|
168
|
+
task: "Fetch GitHub trending repos",
|
|
169
|
+
fileWritten: file,
|
|
170
|
+
succeeded: true,
|
|
171
|
+
userVote: 1, // 1 = thumbs up, -1 = thumbs down
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// Bulk upload with per-file votes (AI grading is skipped)
|
|
175
|
+
await client.uploadBulkCodeSnips(
|
|
176
|
+
["Build a CLI tool", "Add CSV support"],
|
|
177
|
+
files,
|
|
178
|
+
logs,
|
|
179
|
+
true, // useRaysurferAiVoting (ignored when userVotes set)
|
|
180
|
+
{ "app.ts": 1, "utils.ts": -1 } // userVotes
|
|
181
|
+
);
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Method Reference
|
|
185
|
+
|
|
186
|
+
| Method | Description |
|
|
187
|
+
|--------|-------------|
|
|
188
|
+
| `search({ task, topK?, minVerdictScore?, preferComplete?, inputSchema? })` | Unified search for cached code (recommended) |
|
|
189
|
+
| `getCodeFiles({ task, topK?, minVerdictScore?, preferComplete?, cacheDir? })` | Retrieve cached code files with `addToLlmPrompt` for LLM augmentation |
|
|
190
|
+
| `getCodeSnips({ task, topK?, minVerdictScore? })` | Retrieve cached code snippets by semantic search |
|
|
191
|
+
| `retrieveBest({ task, topK?, minVerdictScore? })` | Retrieve the single best match |
|
|
192
|
+
| `getFewShotExamples(task, k)` | Retrieve few-shot examples for code generation prompting |
|
|
193
|
+
| `getTaskPatterns({ task, minThumbsUp?, topK? })` | Retrieve proven task-to-code mappings |
|
|
194
|
+
| `storeCodeBlock({ name, source, entrypoint, language, description, tags?, dependencies?, ... })` | Store a code block with full metadata |
|
|
195
|
+
| `uploadNewCodeSnip({ task, fileWritten, succeeded, useRaysurferAiVoting?, userVote?, executionLogs?, dependencies? })` | Store a single code file with optional dependency versions |
|
|
196
|
+
| `uploadBulkCodeSnips(prompts, filesWritten, logFiles?, useRaysurferAiVoting?, userVotes?)` | Bulk upload for grading (AI votes by default, or provide per-file votes) |
|
|
197
|
+
| `voteCodeSnip({ task, codeBlockId, codeBlockName, codeBlockDescription, succeeded })` | Vote on snippet usefulness |
|
|
198
|
+
|
|
199
|
+
### Exceptions
|
|
200
|
+
|
|
201
|
+
Both clients include built-in retry logic with exponential backoff
|
|
202
|
+
for transient failures (429, 5xx, network errors).
|
|
203
|
+
|
|
204
|
+
| Exception | Description |
|
|
205
|
+
| ----------------------- | ---------------------------------------------------- |
|
|
206
|
+
| `RaySurferError` | Base exception for all Raysurfer errors |
|
|
207
|
+
| `APIError` | API returned an error response (includes `statusCode`) |
|
|
208
|
+
| `AuthenticationError` | API key is invalid or missing |
|
|
209
|
+
| `CacheUnavailableError` | Cache backend is unreachable |
|
|
210
|
+
| `RateLimitError` | Rate limit exceeded after retries (includes `retryAfter`) |
|
|
211
|
+
| `ValidationError` | Request validation failed (includes `field`) |
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
import { RaySurfer, RateLimitError } from "raysurfer";
|
|
215
|
+
|
|
216
|
+
const client = new RaySurfer({ apiKey: "your_api_key" });
|
|
217
|
+
|
|
218
|
+
try {
|
|
219
|
+
const result = await client.getCodeSnips({
|
|
220
|
+
task: "Fetch GitHub repos",
|
|
221
|
+
});
|
|
222
|
+
} catch (e) {
|
|
223
|
+
if (e instanceof RateLimitError) {
|
|
224
|
+
console.log(`Rate limited after retries: ${e.message}`);
|
|
225
|
+
if (e.retryAfter) {
|
|
226
|
+
console.log(`Try again in ${e.retryAfter}ms`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Claude Agent SDK Drop-in
|
|
22
235
|
|
|
23
236
|
Swap your import — everything else stays the same:
|
|
24
237
|
|
|
@@ -40,8 +253,8 @@ for await (const message of query({
|
|
|
40
253
|
}
|
|
41
254
|
```
|
|
42
255
|
|
|
43
|
-
All Claude SDK types are re-exported from `raysurfer`, so you don't
|
|
44
|
-
separate import:
|
|
256
|
+
All Claude SDK types are re-exported from `raysurfer`, so you don't
|
|
257
|
+
need a separate import:
|
|
45
258
|
|
|
46
259
|
```typescript
|
|
47
260
|
import {
|
|
@@ -52,16 +265,7 @@ import {
|
|
|
52
265
|
} from "raysurfer";
|
|
53
266
|
```
|
|
54
267
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
1. **On query**: Retrieves cached code blocks matching your task
|
|
58
|
-
2. **Injects into prompt**: Agent sees proven code snippets
|
|
59
|
-
3. **After success**: New code is cached for next time
|
|
60
|
-
|
|
61
|
-
Caching is enabled automatically when `RAYSURFER_API_KEY` is set. Without it,
|
|
62
|
-
behaves exactly like the original SDK.
|
|
63
|
-
|
|
64
|
-
## Class-based API
|
|
268
|
+
### Class-based API
|
|
65
269
|
|
|
66
270
|
```typescript
|
|
67
271
|
import { ClaudeSDKClient } from "raysurfer";
|
|
@@ -76,7 +280,7 @@ for await (const msg of client.query("Fetch data from GitHub API")) {
|
|
|
76
280
|
}
|
|
77
281
|
```
|
|
78
282
|
|
|
79
|
-
|
|
283
|
+
### System Prompt Preset
|
|
80
284
|
|
|
81
285
|
Use the Claude Code preset system prompt with appended instructions:
|
|
82
286
|
|
|
@@ -95,9 +299,10 @@ for await (const message of query({
|
|
|
95
299
|
}
|
|
96
300
|
```
|
|
97
301
|
|
|
98
|
-
|
|
302
|
+
### Query Control Methods
|
|
99
303
|
|
|
100
|
-
The `query()` function returns a `Query` object with full control
|
|
304
|
+
The `query()` function returns a `Query` object with full control
|
|
305
|
+
methods:
|
|
101
306
|
|
|
102
307
|
```typescript
|
|
103
308
|
const q = query({ prompt: "Build a REST API" });
|
|
@@ -111,6 +316,11 @@ const info = await q.accountInfo();
|
|
|
111
316
|
q.close();
|
|
112
317
|
```
|
|
113
318
|
|
|
319
|
+
### Without Caching
|
|
320
|
+
|
|
321
|
+
If `RAYSURFER_API_KEY` is not set, behaves exactly like the original
|
|
322
|
+
SDK — no caching, just a pass-through wrapper.
|
|
323
|
+
|
|
114
324
|
## Snippet Retrieval Scope
|
|
115
325
|
|
|
116
326
|
Control which cached snippets are retrieved:
|
|
@@ -135,54 +345,17 @@ const enterpriseClient = new ClaudeSDKClient({
|
|
|
135
345
|
| `snipsDesired: "company"` | TEAM or ENTERPRISE |
|
|
136
346
|
| `snipsDesired: "client"` | ENTERPRISE only |
|
|
137
347
|
|
|
138
|
-
##
|
|
348
|
+
## Public Snippets
|
|
139
349
|
|
|
140
|
-
|
|
350
|
+
Include community public snippets (crawled from GitHub) in
|
|
351
|
+
retrieval results alongside your private snippets:
|
|
141
352
|
|
|
142
353
|
```typescript
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const client = new RaySurfer({ apiKey: "your_api_key" });
|
|
146
|
-
|
|
147
|
-
// 1. Get cached code snippets for a task
|
|
148
|
-
const snips = await client.getCodeSnips({
|
|
149
|
-
task: "Fetch GitHub trending repos",
|
|
150
|
-
});
|
|
151
|
-
for (const match of snips.codeBlocks) {
|
|
152
|
-
console.log(`${match.codeBlock.name}: ${match.score}`);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// Or use the unified search endpoint
|
|
156
|
-
const searchResult = await client.search({
|
|
157
|
-
task: "Fetch GitHub trending repos",
|
|
158
|
-
});
|
|
159
|
-
for (const match of searchResult.matches) {
|
|
160
|
-
console.log(`${match.codeBlock.name}: ${match.combinedScore}`);
|
|
161
|
-
}
|
|
354
|
+
// High-level
|
|
355
|
+
const client = new ClaudeSDKClient({ publicSnips: true });
|
|
162
356
|
|
|
163
|
-
//
|
|
164
|
-
|
|
165
|
-
"Fetch GitHub trending repos",
|
|
166
|
-
{ path: "fetch_repos.ts", content: "function fetch() { ... }" },
|
|
167
|
-
true // succeeded
|
|
168
|
-
);
|
|
169
|
-
|
|
170
|
-
// 2b. Bulk upload prompts/logs/code for sandboxed grading
|
|
171
|
-
await client.uploadBulkCodeSnips(
|
|
172
|
-
["Build a CLI tool", "Add CSV support"],
|
|
173
|
-
[{ path: "cli.ts", content: "function main() { ... }" }],
|
|
174
|
-
[{ path: "logs/run.log", content: "Task completed", encoding: "utf-8" }],
|
|
175
|
-
true
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
// 3. Vote on whether a cached snippet was useful
|
|
179
|
-
await client.voteCodeSnip({
|
|
180
|
-
task: "Fetch GitHub trending repos",
|
|
181
|
-
codeBlockId: "abc123",
|
|
182
|
-
codeBlockName: "github_fetcher",
|
|
183
|
-
codeBlockDescription: "Fetches trending repos from GitHub",
|
|
184
|
-
succeeded: true,
|
|
185
|
-
});
|
|
357
|
+
// Low-level
|
|
358
|
+
const rs = new RaySurfer({ apiKey: "...", publicSnips: true });
|
|
186
359
|
```
|
|
187
360
|
|
|
188
361
|
## License
|
package/dist/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* RaySurfer SDK client
|
|
3
3
|
*/
|
|
4
4
|
export declare const VERSION = "0.5.10";
|
|
5
|
-
import type { AgentReview, AgentVerdict, AutoReviewParams, AutoReviewResponse, BulkExecutionResultResponse, ExecutionState, FewShotExample, FileWritten, GetCodeFilesResponse, GetExecutionsParams, LogFile, RetrieveBestResponse, RetrieveCodeBlockResponse, RetrieveExecutionsResponse, SearchResponse, SnipsDesired, StoreCodeBlockResponse, StoreExecutionResponse, SubmitExecutionResultResponse, TaskPattern } from "./types";
|
|
5
|
+
import type { AgentReview, AgentVerdict, AutoReviewParams, AutoReviewResponse, BrowsePublicParams, BrowsePublicResponse, BulkExecutionResultResponse, ExecutionState, FewShotExample, FileWritten, GetCodeFilesResponse, GetExecutionsParams, LogFile, RetrieveBestResponse, RetrieveCodeBlockResponse, RetrieveExecutionsResponse, SearchPublicParams, SearchPublicResponse, SearchResponse, SnipsDesired, StoreCodeBlockResponse, StoreExecutionResponse, SubmitExecutionResultResponse, TaskPattern } from "./types";
|
|
6
6
|
export interface RaySurferOptions {
|
|
7
7
|
/** RaySurfer API key */
|
|
8
8
|
apiKey?: string;
|
|
@@ -18,6 +18,8 @@ export interface RaySurferOptions {
|
|
|
18
18
|
snipsDesired?: SnipsDesired;
|
|
19
19
|
/** Custom namespace for code storage/retrieval (overrides org-based namespacing) */
|
|
20
20
|
namespace?: string;
|
|
21
|
+
/** Include community public snippets (from github-snips) in retrieval results */
|
|
22
|
+
publicSnips?: boolean;
|
|
21
23
|
}
|
|
22
24
|
export interface StoreCodeBlockParams {
|
|
23
25
|
name: string;
|
|
@@ -84,6 +86,7 @@ export declare class RaySurfer {
|
|
|
84
86
|
private workspaceId?;
|
|
85
87
|
private snipsDesired?;
|
|
86
88
|
private namespace?;
|
|
89
|
+
private publicSnips?;
|
|
87
90
|
constructor(options?: RaySurferOptions);
|
|
88
91
|
private request;
|
|
89
92
|
/** Build header overrides for per-request workspaceId */
|
|
@@ -120,11 +123,12 @@ export declare class RaySurfer {
|
|
|
120
123
|
executionLogs?: string;
|
|
121
124
|
runUrl?: string;
|
|
122
125
|
workspaceId?: string;
|
|
126
|
+
dependencies?: Record<string, string>;
|
|
123
127
|
}, fileWritten?: FileWritten, succeeded?: boolean, cachedCodeBlocks?: Array<{
|
|
124
128
|
codeBlockId: string;
|
|
125
129
|
filename: string;
|
|
126
130
|
description: string;
|
|
127
|
-
}>, useRaysurferAiVoting?: boolean, userVote?: number, executionLogs?: string, runUrl?: string, workspaceId?: string): Promise<SubmitExecutionResultResponse>;
|
|
131
|
+
}>, useRaysurferAiVoting?: boolean, userVote?: number, executionLogs?: string, runUrl?: string, workspaceId?: string, dependencies?: Record<string, string>): Promise<SubmitExecutionResultResponse>;
|
|
128
132
|
/** Backwards-compatible alias. */
|
|
129
133
|
uploadNewCodeSnips: (taskOrOptions: string | {
|
|
130
134
|
task: string;
|
|
@@ -140,11 +144,12 @@ export declare class RaySurfer {
|
|
|
140
144
|
executionLogs?: string;
|
|
141
145
|
runUrl?: string;
|
|
142
146
|
workspaceId?: string;
|
|
147
|
+
dependencies?: Record<string, string>;
|
|
143
148
|
}, fileWritten?: FileWritten, succeeded?: boolean, cachedCodeBlocks?: Array<{
|
|
144
149
|
codeBlockId: string;
|
|
145
150
|
filename: string;
|
|
146
151
|
description: string;
|
|
147
|
-
}>, useRaysurferAiVoting?: boolean, userVote?: number, executionLogs?: string, runUrl?: string, workspaceId?: string) => Promise<SubmitExecutionResultResponse>;
|
|
152
|
+
}>, useRaysurferAiVoting?: boolean, userVote?: number, executionLogs?: string, runUrl?: string, workspaceId?: string, dependencies?: Record<string, string>) => Promise<SubmitExecutionResultResponse>;
|
|
148
153
|
/**
|
|
149
154
|
* Bulk upload code files, prompts, and logs for sandboxed grading.
|
|
150
155
|
*
|
|
@@ -214,6 +219,10 @@ export declare class RaySurfer {
|
|
|
214
219
|
votePending: boolean;
|
|
215
220
|
message: string;
|
|
216
221
|
}>;
|
|
222
|
+
/** Browse community public snippets without authentication. */
|
|
223
|
+
browsePublic(params?: BrowsePublicParams): Promise<BrowsePublicResponse>;
|
|
224
|
+
/** Search community public snippets by keyword without authentication. */
|
|
225
|
+
searchPublic(params: SearchPublicParams): Promise<SearchPublicResponse>;
|
|
217
226
|
submitExecutionResult(task: string, fileWritten: FileWritten, succeeded: boolean): Promise<SubmitExecutionResultResponse>;
|
|
218
227
|
retrieve(params: RetrieveParams): Promise<RetrieveCodeBlockResponse>;
|
|
219
228
|
private parseCodeBlock;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,eAAO,MAAM,OAAO,WAAW,CAAC;AAEhC,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAEZ,gBAAgB,EAChB,kBAAkB,EAElB,2BAA2B,EAG3B,cAAc,EACd,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,eAAO,MAAM,OAAO,WAAW,CAAC;AAEhC,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAEZ,gBAAgB,EAChB,kBAAkB,EAElB,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAG3B,cAAc,EACd,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,OAAO,EAEP,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,6BAA6B,EAC7B,WAAW,EACZ,MAAM,SAAS,CAAC;AA2BjB,MAAM,WAAW,gBAAgB;IAC/B,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qE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,CAAC;QACtB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,SAAS,EAAE,OAAO,CAAC;KACpB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IA0BxE,+DAA+D;IACzD,YAAY,CAChB,MAAM,GAAE,kBAAuB,GAC9B,OAAO,CAAC,oBAAoB,CAAC;IA6ChC,0EAA0E;IACpE,YAAY,CAChB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,oBAAoB,CAAC;IAgD1B,qBAAqB,CACzB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,6BAA6B,CAAC;IAKnC,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAS1E,OAAO,CAAC,cAAc;CAqBvB;AAGD,eAAe,SAAS,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { default as RaySurferDefault, RaySurfer, VERSION } from "./client";
|
|
|
16
16
|
export { APIError, AuthenticationError, CacheUnavailableError, RateLimitError, RaySurferError, ValidationError, } from "./errors";
|
|
17
17
|
export type { QueryOptions, QueryParams, RaysurferAgentOptions, RaysurferExtras, RaysurferQueryOptions, } from "./sdk-client";
|
|
18
18
|
export { ClaudeSDKClient, default as queryDefault, query, RaysurferClient, } from "./sdk-client";
|
|
19
|
-
export type { AgentReview, AlternativeCandidate, BestMatch, BulkExecutionResultRequest, BulkExecutionResultResponse, CodeBlock, CodeBlockMatch, CodeFile, ExecutionIO, ExecutionRecord, FewShotExample, FileWritten, GetCodeFilesResponse, LogFile, RetrieveBestResponse, RetrieveCodeBlockResponse, RetrieveExecutionsResponse, SearchMatch, SearchResponse, StoreCodeBlockResponse, StoreExecutionResponse, SubmitExecutionResultRequest, SubmitExecutionResultResponse, TaskPattern, UploadBulkCodeSnipsOptions, UploadNewCodeSnipOptions, VoteCodeSnipParams, VoteCodeSnipResponse, } from "./types";
|
|
19
|
+
export type { AgentReview, AlternativeCandidate, BestMatch, BrowsePublicParams, BrowsePublicResponse, BulkExecutionResultRequest, BulkExecutionResultResponse, CodeBlock, CodeBlockMatch, CodeFile, ExecutionIO, ExecutionRecord, FewShotExample, FileWritten, GetCodeFilesResponse, LogFile, PublicSnippet, RetrieveBestResponse, RetrieveCodeBlockResponse, RetrieveExecutionsResponse, SearchMatch, SearchPublicParams, SearchPublicResponse, SearchResponse, StoreCodeBlockResponse, StoreExecutionResponse, SubmitExecutionResultRequest, SubmitExecutionResultResponse, TaskPattern, UploadBulkCodeSnipsOptions, UploadNewCodeSnipOptions, VoteCodeSnipParams, VoteCodeSnipResponse, } from "./types";
|
|
20
20
|
export { AgentVerdict, ExecutionState } from "./types";
|
|
21
21
|
export type { AccountInfo, AgentDefinition, AgentMcpServerSpec, AnyZodRawShape, ApiKeySource, AsyncHookJSONOutput, BaseHookInput, BaseOutputFormat, CanUseTool, ConfigScope, ExitReason, HookCallback, HookCallbackMatcher, HookEvent, HookInput, HookJSONOutput, InferShape, JsonSchemaOutputFormat, McpHttpServerConfig, McpSdkServerConfig, McpSdkServerConfigWithInstance, McpServerConfig, McpServerConfigForProcessTransport, McpServerStatus, McpSetServersResult, McpSSEServerConfig, McpStdioServerConfig, ModelInfo, ModelUsage, NonNullableUsage, NotificationHookInput, NotificationHookSpecificOutput, Options, OutputFormat, OutputFormatType, PermissionBehavior, PermissionMode, PermissionRequestHookInput, PermissionRequestHookSpecificOutput, PermissionResult, PermissionRuleValue, PermissionUpdate, PermissionUpdateDestination, PostToolUseFailureHookInput, PostToolUseFailureHookSpecificOutput, PostToolUseHookInput, PostToolUseHookSpecificOutput, PreCompactHookInput, PreToolUseHookInput, PreToolUseHookSpecificOutput, Query, RewindFilesResult, SandboxIgnoreViolations, SandboxNetworkConfig, SandboxSettings, SDKAssistantMessage, SDKAssistantMessageError, SDKAuthStatusMessage, SDKCompactBoundaryMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKHookStartedMessage, SDKMessage, SDKPartialAssistantMessage, SDKPermissionDenial, SDKResultError, SDKResultMessage, SDKResultSuccess, SDKStatus, SDKStatusMessage, SDKSystemMessage, SDKTaskNotificationMessage, SDKToolProgressMessage, SDKToolUseSummaryMessage, SDKUserMessage, SDKUserMessageReplay, SdkBeta, SdkMcpToolDefinition, SdkPluginConfig, SessionEndHookInput, SessionStartHookInput, SessionStartHookSpecificOutput, SettingSource, SetupHookInput, SetupHookSpecificOutput, SlashCommand, SpawnedProcess, SpawnOptions, StopHookInput, SubagentStartHookInput, SubagentStartHookSpecificOutput, SubagentStopHookInput, SyncHookJSONOutput, UserPromptSubmitHookInput, UserPromptSubmitHookSpecificOutput, } from "@anthropic-ai/claude-agent-sdk";
|
|
22
22
|
export { AbortError, createSdkMcpServer, EXIT_REASONS, HOOK_EVENTS, tool, } from "@anthropic-ai/claude-agent-sdk";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAE3E,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,YAAY,EACZ,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,eAAe,EACf,OAAO,IAAI,YA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,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,UAAU,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,OAAO,EACP,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,8BAA8B,EAC9B,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,+BAA+B,EAC/B,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,kCAAkC,GACnC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,IAAI,GACL,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAE3E,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,YAAY,EACZ,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,eAAe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AC7B,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,KAAK,EACL,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,UAAU,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,OAAO,EACP,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,8BAA8B,EAC9B,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,+BAA+B,EAC/B,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,kCAAkC,GACnC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,IAAI,GACL,MAAM,gCAAgC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -74,6 +74,18 @@ var DEFAULT_BASE_URL = "https://api.raysurfer.com";
|
|
|
74
74
|
var MAX_RETRIES = 3;
|
|
75
75
|
var RETRY_BASE_DELAY = 500;
|
|
76
76
|
var RETRYABLE_STATUS_CODES = new Set([429, 500, 502, 503, 504]);
|
|
77
|
+
function normalizeDependencies(rawDeps) {
|
|
78
|
+
if (!rawDeps)
|
|
79
|
+
return {};
|
|
80
|
+
if (Array.isArray(rawDeps)) {
|
|
81
|
+
const result = {};
|
|
82
|
+
for (const pkg of rawDeps) {
|
|
83
|
+
result[pkg] = "";
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
return rawDeps;
|
|
88
|
+
}
|
|
77
89
|
|
|
78
90
|
class RaySurfer {
|
|
79
91
|
apiKey;
|
|
@@ -83,6 +95,7 @@ class RaySurfer {
|
|
|
83
95
|
workspaceId;
|
|
84
96
|
snipsDesired;
|
|
85
97
|
namespace;
|
|
98
|
+
publicSnips;
|
|
86
99
|
constructor(options = {}) {
|
|
87
100
|
this.apiKey = options.apiKey;
|
|
88
101
|
this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
|
|
@@ -91,6 +104,7 @@ class RaySurfer {
|
|
|
91
104
|
this.workspaceId = options.workspaceId;
|
|
92
105
|
this.snipsDesired = options.snipsDesired;
|
|
93
106
|
this.namespace = options.namespace;
|
|
107
|
+
this.publicSnips = options.publicSnips;
|
|
94
108
|
}
|
|
95
109
|
async request(method, path, body, headersOverride) {
|
|
96
110
|
const headers = {
|
|
@@ -108,6 +122,9 @@ class RaySurfer {
|
|
|
108
122
|
if (this.snipsDesired) {
|
|
109
123
|
headers["X-Raysurfer-Snips-Desired"] = this.snipsDesired;
|
|
110
124
|
}
|
|
125
|
+
if (this.publicSnips) {
|
|
126
|
+
headers["X-Raysurfer-Public-Snips"] = "true";
|
|
127
|
+
}
|
|
111
128
|
if (this.namespace) {
|
|
112
129
|
headers["X-Raysurfer-Namespace"] = this.namespace;
|
|
113
130
|
}
|
|
@@ -181,7 +198,7 @@ class RaySurfer {
|
|
|
181
198
|
input_schema: params.inputSchema ?? {},
|
|
182
199
|
output_schema: params.outputSchema ?? {},
|
|
183
200
|
language_version: params.languageVersion ?? null,
|
|
184
|
-
dependencies: params.dependencies ??
|
|
201
|
+
dependencies: params.dependencies ?? {},
|
|
185
202
|
tags: params.tags ?? [],
|
|
186
203
|
capabilities: params.capabilities ?? [],
|
|
187
204
|
example_queries: params.exampleQueries ?? null
|
|
@@ -221,7 +238,7 @@ class RaySurfer {
|
|
|
221
238
|
message: result.message
|
|
222
239
|
};
|
|
223
240
|
}
|
|
224
|
-
async uploadNewCodeSnip(taskOrOptions, fileWritten, succeeded, cachedCodeBlocks, useRaysurferAiVoting = true, userVote, executionLogs, runUrl, workspaceId) {
|
|
241
|
+
async uploadNewCodeSnip(taskOrOptions, fileWritten, succeeded, cachedCodeBlocks, useRaysurferAiVoting = true, userVote, executionLogs, runUrl, workspaceId, dependencies) {
|
|
225
242
|
let opts;
|
|
226
243
|
if (typeof taskOrOptions === "object") {
|
|
227
244
|
opts = taskOrOptions;
|
|
@@ -235,7 +252,8 @@ class RaySurfer {
|
|
|
235
252
|
userVote,
|
|
236
253
|
executionLogs,
|
|
237
254
|
runUrl,
|
|
238
|
-
workspaceId
|
|
255
|
+
workspaceId,
|
|
256
|
+
dependencies
|
|
239
257
|
};
|
|
240
258
|
}
|
|
241
259
|
const data = {
|
|
@@ -260,6 +278,9 @@ class RaySurfer {
|
|
|
260
278
|
if (opts.runUrl) {
|
|
261
279
|
data.run_url = opts.runUrl;
|
|
262
280
|
}
|
|
281
|
+
if (opts.dependencies) {
|
|
282
|
+
data.dependencies = opts.dependencies;
|
|
283
|
+
}
|
|
263
284
|
const result = await this.request("POST", "/api/store/execution-result", data, this.workspaceHeaders(opts.workspaceId));
|
|
264
285
|
return {
|
|
265
286
|
success: result.success,
|
|
@@ -331,7 +352,7 @@ class RaySurfer {
|
|
|
331
352
|
filename: m.filename,
|
|
332
353
|
language: m.language,
|
|
333
354
|
entrypoint: m.entrypoint,
|
|
334
|
-
dependencies: m.dependencies
|
|
355
|
+
dependencies: normalizeDependencies(m.dependencies)
|
|
335
356
|
})),
|
|
336
357
|
totalFound: result.total_found,
|
|
337
358
|
cacheHit: result.cache_hit,
|
|
@@ -474,8 +495,9 @@ class RaySurfer {
|
|
|
474
495
|
lines.push(`- **Language**: ${f.language}`);
|
|
475
496
|
lines.push(`- **Entrypoint**: \`${f.entrypoint}\``);
|
|
476
497
|
lines.push(`- **Confidence**: ${Math.round(f.verdictScore * 100)}%`);
|
|
477
|
-
|
|
478
|
-
|
|
498
|
+
const deps = Object.entries(f.dependencies);
|
|
499
|
+
if (deps.length > 0) {
|
|
500
|
+
lines.push(`- **Dependencies**: ${deps.map(([k, v]) => `${k}@${v}`).join(", ")}`);
|
|
479
501
|
}
|
|
480
502
|
}
|
|
481
503
|
lines.push(`
|
|
@@ -581,6 +603,59 @@ class RaySurfer {
|
|
|
581
603
|
message: result.message
|
|
582
604
|
};
|
|
583
605
|
}
|
|
606
|
+
async browsePublic(params = {}) {
|
|
607
|
+
const data = {
|
|
608
|
+
limit: params.limit ?? 20,
|
|
609
|
+
offset: params.offset ?? 0,
|
|
610
|
+
sort_by: params.sortBy ?? "upvoted"
|
|
611
|
+
};
|
|
612
|
+
if (params.language) {
|
|
613
|
+
data.language = params.language;
|
|
614
|
+
}
|
|
615
|
+
const result = await this.request("POST", "/api/snippets/public/list", data);
|
|
616
|
+
return {
|
|
617
|
+
snippets: result.snippets.map((s) => ({
|
|
618
|
+
id: s.id,
|
|
619
|
+
name: s.name,
|
|
620
|
+
description: s.description,
|
|
621
|
+
source: s.source,
|
|
622
|
+
language: s.language,
|
|
623
|
+
entrypoint: s.entrypoint,
|
|
624
|
+
thumbsUp: s.thumbs_up,
|
|
625
|
+
thumbsDown: s.thumbs_down,
|
|
626
|
+
createdAt: s.created_at,
|
|
627
|
+
namespace: s.namespace
|
|
628
|
+
})),
|
|
629
|
+
total: result.total,
|
|
630
|
+
hasMore: result.has_more
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
async searchPublic(params) {
|
|
634
|
+
const data = {
|
|
635
|
+
query: params.query,
|
|
636
|
+
limit: params.limit ?? 20
|
|
637
|
+
};
|
|
638
|
+
if (params.language) {
|
|
639
|
+
data.language = params.language;
|
|
640
|
+
}
|
|
641
|
+
const result = await this.request("POST", "/api/snippets/public/search", data);
|
|
642
|
+
return {
|
|
643
|
+
snippets: result.snippets.map((s) => ({
|
|
644
|
+
id: s.id,
|
|
645
|
+
name: s.name,
|
|
646
|
+
description: s.description,
|
|
647
|
+
source: s.source,
|
|
648
|
+
language: s.language,
|
|
649
|
+
entrypoint: s.entrypoint,
|
|
650
|
+
thumbsUp: s.thumbs_up,
|
|
651
|
+
thumbsDown: s.thumbs_down,
|
|
652
|
+
createdAt: s.created_at,
|
|
653
|
+
namespace: s.namespace
|
|
654
|
+
})),
|
|
655
|
+
total: result.total,
|
|
656
|
+
query: result.query
|
|
657
|
+
};
|
|
658
|
+
}
|
|
584
659
|
async submitExecutionResult(task, fileWritten, succeeded) {
|
|
585
660
|
return this.uploadNewCodeSnip(task, fileWritten, succeeded);
|
|
586
661
|
}
|
|
@@ -598,7 +673,7 @@ class RaySurfer {
|
|
|
598
673
|
outputSchema: data.output_schema ?? {},
|
|
599
674
|
language: data.language,
|
|
600
675
|
languageVersion: data.language_version,
|
|
601
|
-
dependencies: data.dependencies
|
|
676
|
+
dependencies: normalizeDependencies(data.dependencies),
|
|
602
677
|
tags: data.tags ?? [],
|
|
603
678
|
capabilities: data.capabilities ?? [],
|
|
604
679
|
exampleQueries: data.example_queries,
|
|
@@ -669,12 +744,20 @@ function augmentSystemPrompt(systemPrompt, addition) {
|
|
|
669
744
|
return addition;
|
|
670
745
|
}
|
|
671
746
|
function splitOptions(options) {
|
|
672
|
-
const {
|
|
747
|
+
const {
|
|
748
|
+
workspaceId,
|
|
749
|
+
namespace,
|
|
750
|
+
publicSnips,
|
|
751
|
+
debug,
|
|
752
|
+
workingDirectory,
|
|
753
|
+
...sdkOptions
|
|
754
|
+
} = options;
|
|
673
755
|
return {
|
|
674
756
|
sdkOptions,
|
|
675
757
|
extras: {
|
|
676
758
|
workspaceId,
|
|
677
759
|
namespace,
|
|
760
|
+
publicSnips,
|
|
678
761
|
debug,
|
|
679
762
|
workingDirectory
|
|
680
763
|
}
|
|
@@ -736,7 +819,8 @@ class RaysurferQuery {
|
|
|
736
819
|
baseUrl: this._baseUrl,
|
|
737
820
|
workspaceId: this._extras.workspaceId,
|
|
738
821
|
snipsDesired: this._extras.workspaceId ? "client" : undefined,
|
|
739
|
-
namespace: this._extras.namespace
|
|
822
|
+
namespace: this._extras.namespace,
|
|
823
|
+
publicSnips: this._extras.publicSnips
|
|
740
824
|
});
|
|
741
825
|
try {
|
|
742
826
|
this._debug.time("Cache lookup");
|
package/dist/sdk-client.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export interface RaysurferExtras {
|
|
|
18
18
|
workspaceId?: string;
|
|
19
19
|
/** Custom namespace for code storage/retrieval */
|
|
20
20
|
namespace?: string;
|
|
21
|
+
/** Include community public snippets (from github-snips) in retrieval results */
|
|
22
|
+
publicSnips?: boolean;
|
|
21
23
|
/** Enable debug logging - also enabled via RAYSURFER_DEBUG=true env var */
|
|
22
24
|
debug?: boolean;
|
|
23
25
|
/** @deprecated Use `cwd` instead */
|
package/dist/sdk-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-client.d.ts","sourceRoot":"","sources":["../src/sdk-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAMV,OAAO,EAEP,KAAK,EAGL,cAAc,EAEf,MAAM,gCAAgC,CAAC;AA6DxC,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,4EAA4E;AAC5E,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,eAAe,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,qBAAqB,CAAC;AAEjD,kDAAkD;AAClD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,qBAAqB,CAAC;CACj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lock {
|
|
|
27
27
|
outputSchema: Record<string, unknown>;
|
|
28
28
|
language: string;
|
|
29
29
|
languageVersion?: string | null;
|
|
30
|
-
|
|
30
|
+
/** Package name -> version (e.g., {"pandas": "2.1.0"}) */
|
|
31
|
+
dependencies: Record<string, string>;
|
|
31
32
|
tags: string[];
|
|
32
33
|
capabilities: string[];
|
|
33
34
|
exampleQueries?: string[] | null;
|
|
@@ -192,7 +193,8 @@ export interface CodeFile {
|
|
|
192
193
|
inputSchema: Record<string, unknown>;
|
|
193
194
|
outputSchema: Record<string, unknown>;
|
|
194
195
|
language: string;
|
|
195
|
-
|
|
196
|
+
/** Package name -> version (e.g., {"pandas": "2.1.0"}) */
|
|
197
|
+
dependencies: Record<string, string>;
|
|
196
198
|
/** Rating score: thumbsUp / (thumbsUp + thumbsDown), 0.3 if unrated */
|
|
197
199
|
verdictScore: number;
|
|
198
200
|
thumbsUp: number;
|
|
@@ -222,7 +224,8 @@ export interface SearchMatch {
|
|
|
222
224
|
filename: string;
|
|
223
225
|
language: string;
|
|
224
226
|
entrypoint: string;
|
|
225
|
-
|
|
227
|
+
/** Package name -> version (e.g., {"pandas": "2.1.0"}) */
|
|
228
|
+
dependencies: Record<string, string>;
|
|
226
229
|
}
|
|
227
230
|
/** Response from unified search endpoint */
|
|
228
231
|
export interface SearchResponse {
|
|
@@ -290,6 +293,46 @@ export interface UploadNewCodeSnipOptions {
|
|
|
290
293
|
executionLogs?: string;
|
|
291
294
|
runUrl?: string;
|
|
292
295
|
workspaceId?: string;
|
|
296
|
+
/** Package dependencies with versions (e.g., {"pandas": "2.1.0"}) */
|
|
297
|
+
dependencies?: Record<string, string>;
|
|
298
|
+
}
|
|
299
|
+
/** A public community snippet from the curated namespace */
|
|
300
|
+
export interface PublicSnippet {
|
|
301
|
+
id: string;
|
|
302
|
+
name: string;
|
|
303
|
+
description: string;
|
|
304
|
+
source: string;
|
|
305
|
+
language: string;
|
|
306
|
+
entrypoint: string;
|
|
307
|
+
thumbsUp: number;
|
|
308
|
+
thumbsDown: number;
|
|
309
|
+
createdAt: string | null;
|
|
310
|
+
namespace: string;
|
|
311
|
+
}
|
|
312
|
+
/** Response from browsing public snippets */
|
|
313
|
+
export interface BrowsePublicResponse {
|
|
314
|
+
snippets: PublicSnippet[];
|
|
315
|
+
total: number;
|
|
316
|
+
hasMore: boolean;
|
|
317
|
+
}
|
|
318
|
+
/** Response from searching public snippets */
|
|
319
|
+
export interface SearchPublicResponse {
|
|
320
|
+
snippets: PublicSnippet[];
|
|
321
|
+
total: number;
|
|
322
|
+
query: string;
|
|
323
|
+
}
|
|
324
|
+
/** Params for browsing public snippets */
|
|
325
|
+
export interface BrowsePublicParams {
|
|
326
|
+
limit?: number;
|
|
327
|
+
offset?: number;
|
|
328
|
+
sortBy?: "upvoted" | "recent";
|
|
329
|
+
language?: string;
|
|
330
|
+
}
|
|
331
|
+
/** Params for searching public snippets */
|
|
332
|
+
export interface SearchPublicParams {
|
|
333
|
+
query: string;
|
|
334
|
+
limit?: number;
|
|
335
|
+
language?: string;
|
|
293
336
|
}
|
|
294
337
|
/** Options for uploadBulkCodeSnips (kwargs-style) */
|
|
295
338
|
export interface UploadBulkCodeSnipsOptions {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,2DAA2D;AAC3D,oBAAY,cAAc;IACxB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;CACxB;AAED,0DAA0D;AAC1D,oBAAY,YAAY;IACtB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;CACpB;AAED,8CAA8C;AAC9C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhD,+DAA+D;AAC/D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAA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