raysurfer 0.3.10 → 0.4.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 +1 -1
- package/dist/client.d.ts +6 -38
- package/dist/client.d.ts.map +1 -1
- package/dist/errors.d.ts +15 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +133 -13166
- package/dist/sdk-client.d.ts.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -136,7 +136,7 @@ for (const match of snips.codeBlocks) {
|
|
|
136
136
|
// 2. Upload new code snippets after execution
|
|
137
137
|
await client.uploadNewCodeSnips(
|
|
138
138
|
"Fetch GitHub trending repos",
|
|
139
|
-
[{
|
|
139
|
+
[{ path: "fetch_repos.ts", content: "function fetch() { ... }" }],
|
|
140
140
|
true // succeeded
|
|
141
141
|
);
|
|
142
142
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* RaySurfer SDK client
|
|
3
3
|
*/
|
|
4
|
-
export declare const VERSION = "0.
|
|
4
|
+
export declare const VERSION = "0.4.0";
|
|
5
5
|
import type { AgentReview, AgentVerdict, AutoReviewParams, AutoReviewResponse, ExecutionState, FewShotExample, FileWritten, GetCodeFilesResponse, GetExecutionsParams, RetrieveBestResponse, RetrieveCodeBlockResponse, RetrieveExecutionsResponse, SnipsDesired, StoreCodeBlockResponse, StoreExecutionResponse, SubmitExecutionResultResponse, TaskPattern } from "./types";
|
|
6
6
|
export interface RaySurferOptions {
|
|
7
7
|
/** RaySurfer API key */
|
|
@@ -85,7 +85,7 @@ export declare class RaySurfer {
|
|
|
85
85
|
/** Store an execution record */
|
|
86
86
|
storeExecution(params: StoreExecutionParams): Promise<StoreExecutionResponse>;
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* Upload new code snippets from an execution result.
|
|
89
89
|
*
|
|
90
90
|
* This is the simplified API for agent integrations. Just send:
|
|
91
91
|
* - The task that was executed
|
|
@@ -96,13 +96,13 @@ export declare class RaySurfer {
|
|
|
96
96
|
* Backend handles: entrypoint detection, tag extraction, language detection,
|
|
97
97
|
* deduplication, quality checks, storage, AND voting for cached code blocks.
|
|
98
98
|
*/
|
|
99
|
-
|
|
99
|
+
uploadNewCodeSnips(task: string, filesWritten: FileWritten[], succeeded: boolean, cachedCodeBlocks?: Array<{
|
|
100
100
|
codeBlockId: string;
|
|
101
101
|
filename: string;
|
|
102
102
|
description: string;
|
|
103
103
|
}>): Promise<SubmitExecutionResultResponse>;
|
|
104
|
-
/**
|
|
105
|
-
|
|
104
|
+
/** Get cached code snippets for a task (semantic search) */
|
|
105
|
+
getCodeSnips(params: RetrieveParams): Promise<RetrieveCodeBlockResponse>;
|
|
106
106
|
/** Get the single best code block for a task using verdict-aware scoring */
|
|
107
107
|
retrieveBest(params: RetrieveParams): Promise<RetrieveBestResponse>;
|
|
108
108
|
/** Retrieve few-shot examples for code generation */
|
|
@@ -136,44 +136,12 @@ export declare class RaySurfer {
|
|
|
136
136
|
*/
|
|
137
137
|
getExecutions(params?: GetExecutionsParams): Promise<RetrieveExecutionsResponse>;
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
139
|
+
* Vote on whether a cached code snippet was useful for a task.
|
|
140
140
|
*
|
|
141
141
|
* This triggers background voting on the backend to assess whether
|
|
142
142
|
* the cached code actually helped complete the task successfully.
|
|
143
143
|
* The call returns immediately - voting happens asynchronously.
|
|
144
144
|
*/
|
|
145
|
-
recordCacheUsage(params: {
|
|
146
|
-
task: string;
|
|
147
|
-
codeBlockId: string;
|
|
148
|
-
codeBlockName: string;
|
|
149
|
-
codeBlockDescription: string;
|
|
150
|
-
succeeded: boolean;
|
|
151
|
-
}): Promise<{
|
|
152
|
-
success: boolean;
|
|
153
|
-
votePending: boolean;
|
|
154
|
-
message: string;
|
|
155
|
-
}>;
|
|
156
|
-
/**
|
|
157
|
-
* Get cached code snippets for a task.
|
|
158
|
-
*
|
|
159
|
-
* Alias for retrieve() - searches for code blocks by task description.
|
|
160
|
-
*/
|
|
161
|
-
getCodeSnips(params: RetrieveParams): Promise<RetrieveCodeBlockResponse>;
|
|
162
|
-
/**
|
|
163
|
-
* Upload new code snippets from an execution.
|
|
164
|
-
*
|
|
165
|
-
* Alias for submitExecutionResult() - stores code files for future reuse.
|
|
166
|
-
*/
|
|
167
|
-
uploadNewCodeSnips(task: string, filesWritten: FileWritten[], succeeded: boolean, cachedCodeBlocks?: Array<{
|
|
168
|
-
codeBlockId: string;
|
|
169
|
-
filename: string;
|
|
170
|
-
description: string;
|
|
171
|
-
}>): Promise<SubmitExecutionResultResponse>;
|
|
172
|
-
/**
|
|
173
|
-
* Vote on whether a cached code snippet was useful.
|
|
174
|
-
*
|
|
175
|
-
* Alias for recordCacheUsage() - triggers background voting.
|
|
176
|
-
*/
|
|
177
145
|
voteCodeSnip(params: {
|
|
178
146
|
task: string;
|
|
179
147
|
codeBlockId: string;
|
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;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAEZ,gBAAgB,EAChB,kBAAkB,EAKlB,cAAc,EACd,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,6BAA6B,EAC7B,WAAW,EACZ,MAAM,SAAS,CAAC;AAQjB,MAAM,WAAW,gBAAgB;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AAO,CAAC,cAAc;CAmBvB;AAGD,eAAe,SAAS,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -14,4 +14,19 @@ export declare class APIError extends RaySurferError {
|
|
|
14
14
|
export declare class AuthenticationError extends RaySurferError {
|
|
15
15
|
constructor(message?: string);
|
|
16
16
|
}
|
|
17
|
+
/** Cache backend is unreachable */
|
|
18
|
+
export declare class CacheUnavailableError extends RaySurferError {
|
|
19
|
+
statusCode: number;
|
|
20
|
+
constructor(message?: string, statusCode?: number);
|
|
21
|
+
}
|
|
22
|
+
/** Rate limit exceeded */
|
|
23
|
+
export declare class RateLimitError extends RaySurferError {
|
|
24
|
+
retryAfter?: number;
|
|
25
|
+
constructor(message?: string, retryAfter?: number);
|
|
26
|
+
}
|
|
27
|
+
/** Validation failed */
|
|
28
|
+
export declare class ValidationError extends RaySurferError {
|
|
29
|
+
field?: string;
|
|
30
|
+
constructor(message?: string, field?: string);
|
|
31
|
+
}
|
|
17
32
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,mCAAmC;AACnC,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAED,qCAAqC;AACrC,qBAAa,QAAS,SAAQ,cAAc;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;gBAER,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;CAKjD;AAED,4BAA4B;AAC5B,qBAAa,mBAAoB,SAAQ,cAAc;gBACzC,OAAO,GAAE,MAA0B;CAIhD"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,mCAAmC;AACnC,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAED,qCAAqC;AACrC,qBAAa,QAAS,SAAQ,cAAc;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;gBAER,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;CAKjD;AAED,4BAA4B;AAC5B,qBAAa,mBAAoB,SAAQ,cAAc;gBACzC,OAAO,GAAE,MAA0B;CAIhD;AAED,mCAAmC;AACnC,qBAAa,qBAAsB,SAAQ,cAAc;IACvD,UAAU,EAAE,MAAM,CAAC;gBAGjB,OAAO,GAAE,MAAuC,EAChD,UAAU,GAAE,MAAY;CAM3B;AAED,0BAA0B;AAC1B,qBAAa,cAAe,SAAQ,cAAc;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;gBAER,OAAO,GAAE,MAA8B,EAAE,UAAU,CAAC,EAAE,MAAM;CAKzE;AAED,wBAAwB;AACxB,qBAAa,eAAgB,SAAQ,cAAc;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;gBAEH,OAAO,GAAE,MAA4B,EAAE,KAAK,CAAC,EAAE,MAAM;CAKlE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export type { GetCodeFilesParams, GetTaskPatternsParams, RaySurferOptions, RetrieveParams, StoreCodeBlockParams, StoreExecutionParams, } from "./client";
|
|
15
15
|
export { default as RaySurferDefault, RaySurfer, VERSION } from "./client";
|
|
16
|
-
export { APIError, AuthenticationError, RaySurferError } from "./errors";
|
|
16
|
+
export { APIError, AuthenticationError, CacheUnavailableError, RateLimitError, RaySurferError, ValidationError, } from "./errors";
|
|
17
17
|
export type { QueryOptions, QueryParams, RaysurferAgentOptions, } from "./sdk-client";
|
|
18
18
|
export { ClaudeSDKClient, default as queryDefault, query, RaysurferClient, } from "./sdk-client";
|
|
19
|
-
export type { AgentReview, AlternativeCandidate, BestMatch, CodeBlock, CodeBlockMatch, CodeFile, ExecutionIO, ExecutionRecord, FewShotExample, FileWritten, GetCodeFilesResponse,
|
|
19
|
+
export type { AgentReview, AlternativeCandidate, BestMatch, CodeBlock, CodeBlockMatch, CodeFile, ExecutionIO, ExecutionRecord, FewShotExample, FileWritten, GetCodeFilesResponse, RetrieveBestResponse, RetrieveCodeBlockResponse, RetrieveExecutionsResponse, StoreCodeBlockResponse, StoreExecutionResponse, SubmitExecutionResultRequest, SubmitExecutionResultResponse, TaskPattern, VoteCodeSnipParams, VoteCodeSnipResponse, } from "./types";
|
|
20
20
|
export { AgentVerdict, ExecutionState } from "./types";
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
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;AAEH,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAE3E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,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,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,eAAe,EACf,OAAO,IAAI,YAAY,EACvB,KAAK,EACL,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,cAAc,EACd,QAAQ,EACR,WAAW,EACX,eAAe,EACf,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,6BAA6B,EAC7B,WAAW,EACX,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|