raysurfer 0.7.1 → 0.7.3
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/dist/client.d.ts +226 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/errors.d.ts +32 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1282 -0
- package/dist/sdk-client.d.ts +69 -0
- package/dist/sdk-client.d.ts.map +1 -0
- package/dist/types.d.ts +388 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drop-in replacement for Claude Agent SDK with automatic code caching.
|
|
3
|
+
*
|
|
4
|
+
* Simply swap your import:
|
|
5
|
+
*
|
|
6
|
+
* // Before
|
|
7
|
+
* import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
8
|
+
*
|
|
9
|
+
* // After
|
|
10
|
+
* import { query } from "raysurfer";
|
|
11
|
+
*
|
|
12
|
+
* Everything else works exactly the same. Set RAYSURFER_API_KEY to enable caching.
|
|
13
|
+
*/
|
|
14
|
+
import type { Options, Query, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
15
|
+
/** Raysurfer-specific options beyond Claude SDK Options */
|
|
16
|
+
export interface RaysurferExtras {
|
|
17
|
+
/** Workspace ID for per-customer isolation (enterprise only) */
|
|
18
|
+
workspaceId?: string;
|
|
19
|
+
/** Include community public snippets (from github-snips) in retrieval results */
|
|
20
|
+
publicSnips?: boolean;
|
|
21
|
+
/** Enable debug logging - also enabled via RAYSURFER_DEBUG=true env var */
|
|
22
|
+
debug?: boolean;
|
|
23
|
+
/** @deprecated Use `cwd` instead */
|
|
24
|
+
workingDirectory?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Full query options: Claude SDK Options extended with Raysurfer extras */
|
|
27
|
+
export type RaysurferQueryOptions = Options & RaysurferExtras;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use RaysurferQueryOptions instead
|
|
30
|
+
*/
|
|
31
|
+
export type QueryOptions = RaysurferQueryOptions;
|
|
32
|
+
/** Query parameters - matches Claude Agent SDK */
|
|
33
|
+
export interface QueryParams {
|
|
34
|
+
prompt: string | AsyncIterable<SDKUserMessage>;
|
|
35
|
+
options?: RaysurferQueryOptions;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Drop-in replacement for Claude Agent SDK's query function with automatic caching.
|
|
39
|
+
*
|
|
40
|
+
* Usage is identical to the original:
|
|
41
|
+
*
|
|
42
|
+
* import { query } from "raysurfer";
|
|
43
|
+
*
|
|
44
|
+
* for await (const message of query({ prompt: "Hello" })) {
|
|
45
|
+
* console.log(message);
|
|
46
|
+
* }
|
|
47
|
+
*
|
|
48
|
+
* Set RAYSURFER_API_KEY environment variable to enable caching.
|
|
49
|
+
*/
|
|
50
|
+
export declare function query(params: QueryParams): Query;
|
|
51
|
+
/**
|
|
52
|
+
* ClaudeSDKClient - Class-based drop-in replacement.
|
|
53
|
+
*
|
|
54
|
+
* For users who prefer the Python-style class interface:
|
|
55
|
+
*
|
|
56
|
+
* const client = new ClaudeSDKClient(options);
|
|
57
|
+
* for await (const msg of client.query("Hello")) {
|
|
58
|
+
* console.log(msg);
|
|
59
|
+
* }
|
|
60
|
+
*/
|
|
61
|
+
export declare class ClaudeSDKClient {
|
|
62
|
+
private options;
|
|
63
|
+
constructor(options?: RaysurferQueryOptions);
|
|
64
|
+
query(prompt: string | AsyncIterable<SDKUserMessage>): Query;
|
|
65
|
+
}
|
|
66
|
+
export { ClaudeSDKClient as RaysurferClient };
|
|
67
|
+
export type { RaysurferQueryOptions as RaysurferAgentOptions };
|
|
68
|
+
export default query;
|
|
69
|
+
//# sourceMappingURL=sdk-client.d.ts.map
|
|
@@ -0,0 +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;AAoGxC,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,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;CACjC;AAokBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,KAAK,CAEhD;AAED;;;;;;;;;GASG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAwB;gBAE3B,OAAO,GAAE,qBAA0B;IAI/C,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,cAAc,CAAC,GAAG,KAAK;CAG7D;AAGD,OAAO,EAAE,eAAe,IAAI,eAAe,EAAE,CAAC;AAC9C,YAAY,EAAE,qBAAqB,IAAI,qBAAqB,EAAE,CAAC;AAE/D,eAAe,KAAK,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RaySurfer SDK types - mirrors the backend API types
|
|
3
|
+
*/
|
|
4
|
+
/** JSON-serializable value for unstructured execution output data */
|
|
5
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
6
|
+
[key: string]: JsonValue;
|
|
7
|
+
};
|
|
8
|
+
/** Technical execution outcome - NOT a quality judgment */
|
|
9
|
+
export declare enum ExecutionState {
|
|
10
|
+
COMPLETED = "completed",
|
|
11
|
+
ERRORED = "errored",
|
|
12
|
+
TIMED_OUT = "timed_out",
|
|
13
|
+
CANCELLED = "cancelled"
|
|
14
|
+
}
|
|
15
|
+
/** Agent's judgment on whether an execution was useful */
|
|
16
|
+
export declare enum AgentVerdict {
|
|
17
|
+
THUMBS_UP = "thumbs_up",
|
|
18
|
+
THUMBS_DOWN = "thumbs_down",
|
|
19
|
+
PENDING = "pending"
|
|
20
|
+
}
|
|
21
|
+
/** Scope of private snippets for retrieval */
|
|
22
|
+
export type SnipsDesired = "company" | "client";
|
|
23
|
+
/** A stored code block with metadata for semantic retrieval */
|
|
24
|
+
export interface CodeBlock {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
source: string;
|
|
29
|
+
entrypoint: string;
|
|
30
|
+
inputSchema: Record<string, JsonValue>;
|
|
31
|
+
outputSchema: Record<string, JsonValue>;
|
|
32
|
+
language: string;
|
|
33
|
+
languageVersion?: string | null;
|
|
34
|
+
/** Package name -> version (e.g., {"pandas": "2.1.0"}) */
|
|
35
|
+
dependencies: Record<string, string>;
|
|
36
|
+
tags: string[];
|
|
37
|
+
capabilities: string[];
|
|
38
|
+
exampleQueries?: string[] | null;
|
|
39
|
+
createdAt?: string | null;
|
|
40
|
+
updatedAt?: string | null;
|
|
41
|
+
}
|
|
42
|
+
/** Stores the actual input/output data */
|
|
43
|
+
export interface ExecutionIO {
|
|
44
|
+
inputData: Record<string, JsonValue>;
|
|
45
|
+
inputHash?: string;
|
|
46
|
+
outputData?: JsonValue;
|
|
47
|
+
outputHash?: string;
|
|
48
|
+
outputType?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Agent's assessment of whether an execution was useful */
|
|
51
|
+
export interface AgentReview {
|
|
52
|
+
timestamp?: string;
|
|
53
|
+
verdict: AgentVerdict;
|
|
54
|
+
reasoning: string;
|
|
55
|
+
whatWorked: string[];
|
|
56
|
+
whatDidntWork: string[];
|
|
57
|
+
outputWasUseful: boolean;
|
|
58
|
+
outputWasCorrect: boolean;
|
|
59
|
+
outputWasComplete: boolean;
|
|
60
|
+
errorWasAppropriate?: boolean | null;
|
|
61
|
+
wouldUseAgain: boolean;
|
|
62
|
+
suggestedImprovements: string[];
|
|
63
|
+
requiredWorkaround?: boolean;
|
|
64
|
+
workaroundDescription?: string | null;
|
|
65
|
+
}
|
|
66
|
+
/** Full execution trace */
|
|
67
|
+
export interface ExecutionRecord {
|
|
68
|
+
id: string;
|
|
69
|
+
codeBlockId: string;
|
|
70
|
+
timestamp?: string;
|
|
71
|
+
executionState: ExecutionState;
|
|
72
|
+
durationMs: number;
|
|
73
|
+
errorMessage?: string | null;
|
|
74
|
+
errorType?: string | null;
|
|
75
|
+
io: ExecutionIO;
|
|
76
|
+
triggeringTask: string;
|
|
77
|
+
retrievalScore?: number;
|
|
78
|
+
verdict?: AgentVerdict;
|
|
79
|
+
review?: AgentReview | null;
|
|
80
|
+
}
|
|
81
|
+
/** The best matching code block with scoring */
|
|
82
|
+
export interface BestMatch {
|
|
83
|
+
codeBlock: CodeBlock;
|
|
84
|
+
score: number;
|
|
85
|
+
thumbsUp: number;
|
|
86
|
+
thumbsDown: number;
|
|
87
|
+
}
|
|
88
|
+
/** An alternative candidate code block */
|
|
89
|
+
export interface AlternativeCandidate {
|
|
90
|
+
codeBlockId: string;
|
|
91
|
+
name: string;
|
|
92
|
+
score: number;
|
|
93
|
+
reason: string;
|
|
94
|
+
}
|
|
95
|
+
/** A few-shot example for code generation */
|
|
96
|
+
export interface FewShotExample {
|
|
97
|
+
task: string;
|
|
98
|
+
inputSample: Record<string, JsonValue>;
|
|
99
|
+
outputSample: JsonValue;
|
|
100
|
+
codeSnippet: string;
|
|
101
|
+
}
|
|
102
|
+
/** A proven task->code mapping */
|
|
103
|
+
export interface TaskPattern {
|
|
104
|
+
taskPattern: string;
|
|
105
|
+
codeBlockId: string;
|
|
106
|
+
codeBlockName: string;
|
|
107
|
+
thumbsUp: number;
|
|
108
|
+
thumbsDown: number;
|
|
109
|
+
lastThumbsUp?: string | null;
|
|
110
|
+
lastThumbsDown?: string | null;
|
|
111
|
+
}
|
|
112
|
+
/** A file written during agent execution */
|
|
113
|
+
export interface FileWritten {
|
|
114
|
+
path: string;
|
|
115
|
+
content: string;
|
|
116
|
+
}
|
|
117
|
+
/** A log file for bulk grading (content may be base64) */
|
|
118
|
+
export interface LogFile {
|
|
119
|
+
path: string;
|
|
120
|
+
content: string;
|
|
121
|
+
encoding?: "utf-8" | "base64";
|
|
122
|
+
contentType?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface StoreCodeBlockResponse {
|
|
125
|
+
success: boolean;
|
|
126
|
+
codeBlockId: string;
|
|
127
|
+
embeddingId: string;
|
|
128
|
+
message: string;
|
|
129
|
+
}
|
|
130
|
+
export interface StoreExecutionResponse {
|
|
131
|
+
success: boolean;
|
|
132
|
+
executionId: string;
|
|
133
|
+
patternUpdated: boolean;
|
|
134
|
+
message: string;
|
|
135
|
+
}
|
|
136
|
+
export interface CodeBlockMatch {
|
|
137
|
+
codeBlock: CodeBlock;
|
|
138
|
+
score: number;
|
|
139
|
+
thumbsUp: number;
|
|
140
|
+
thumbsDown: number;
|
|
141
|
+
recentExecutions: ExecutionRecord[];
|
|
142
|
+
}
|
|
143
|
+
export interface RetrieveCodeBlockResponse {
|
|
144
|
+
codeBlocks: CodeBlockMatch[];
|
|
145
|
+
totalFound: number;
|
|
146
|
+
}
|
|
147
|
+
export interface RetrieveBestResponse {
|
|
148
|
+
bestMatch: BestMatch | null;
|
|
149
|
+
alternativeCandidates: AlternativeCandidate[];
|
|
150
|
+
retrievalConfidence: string;
|
|
151
|
+
}
|
|
152
|
+
export interface SubmitExecutionResultRequest {
|
|
153
|
+
task: string;
|
|
154
|
+
fileWritten: FileWritten;
|
|
155
|
+
succeeded: boolean;
|
|
156
|
+
/** Let Raysurfer AI vote on stored blocks (default true). Ignored when userVote is provided. */
|
|
157
|
+
useRaysurferAiVoting?: boolean;
|
|
158
|
+
/** User-provided vote: 1 for thumbs up, -1 for thumbs down. When provided, AI voting is skipped. */
|
|
159
|
+
userVote?: number;
|
|
160
|
+
/** URL to the finished run (e.g. logs page, CI run, LangSmith trace) */
|
|
161
|
+
runUrl?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface SubmitExecutionResultResponse {
|
|
164
|
+
success: boolean;
|
|
165
|
+
codeBlocksStored: number;
|
|
166
|
+
message: string;
|
|
167
|
+
snippetName?: string | null;
|
|
168
|
+
}
|
|
169
|
+
export interface BulkExecutionResultRequest {
|
|
170
|
+
prompts: string[];
|
|
171
|
+
filesWritten: FileWritten[];
|
|
172
|
+
logFiles?: LogFile[];
|
|
173
|
+
/** Let Raysurfer AI vote on stored blocks (default true). Ignored when userVotes is provided. */
|
|
174
|
+
useRaysurferAiVoting?: boolean;
|
|
175
|
+
/** Dict of filename to vote (1 for thumbs up, -1 for thumbs down). When provided, AI voting is skipped. */
|
|
176
|
+
userVotes?: Record<string, number>;
|
|
177
|
+
}
|
|
178
|
+
export interface BulkExecutionResultResponse {
|
|
179
|
+
success: boolean;
|
|
180
|
+
codeBlocksStored: number;
|
|
181
|
+
votesQueued: number;
|
|
182
|
+
message: string;
|
|
183
|
+
statusUrl?: string | null;
|
|
184
|
+
}
|
|
185
|
+
/** A code file ready to be written to sandbox */
|
|
186
|
+
export interface CodeFile {
|
|
187
|
+
codeBlockId: string;
|
|
188
|
+
filename: string;
|
|
189
|
+
source: string;
|
|
190
|
+
entrypoint: string;
|
|
191
|
+
description: string;
|
|
192
|
+
inputSchema: Record<string, JsonValue>;
|
|
193
|
+
outputSchema: Record<string, JsonValue>;
|
|
194
|
+
language: string;
|
|
195
|
+
/** Package name -> version (e.g., {"pandas": "2.1.0"}) */
|
|
196
|
+
dependencies: Record<string, string>;
|
|
197
|
+
score: number;
|
|
198
|
+
thumbsUp: number;
|
|
199
|
+
thumbsDown: number;
|
|
200
|
+
}
|
|
201
|
+
/** Response with code files for a task */
|
|
202
|
+
export interface GetCodeFilesResponse {
|
|
203
|
+
files: CodeFile[];
|
|
204
|
+
task: string;
|
|
205
|
+
totalFound: number;
|
|
206
|
+
/** Pre-formatted string to append to LLM system prompt with all file paths */
|
|
207
|
+
addToLlmPrompt: string;
|
|
208
|
+
}
|
|
209
|
+
/** A search match with scoring */
|
|
210
|
+
export interface SearchMatch {
|
|
211
|
+
codeBlock: CodeBlock;
|
|
212
|
+
score: number;
|
|
213
|
+
/** Compatibility alias used by older wrappers. */
|
|
214
|
+
combinedScore: number;
|
|
215
|
+
/** Compatibility alias used by older wrappers. */
|
|
216
|
+
vectorScore: number;
|
|
217
|
+
/** Compatibility alias used by older wrappers. */
|
|
218
|
+
verdictScore: number;
|
|
219
|
+
thumbsUp: number;
|
|
220
|
+
thumbsDown: number;
|
|
221
|
+
filename: string;
|
|
222
|
+
language: string;
|
|
223
|
+
entrypoint: string;
|
|
224
|
+
/** Package name -> version (e.g., {"pandas": "2.1.0"}) */
|
|
225
|
+
dependencies: Record<string, string>;
|
|
226
|
+
comments: Record<string, JsonValue>[];
|
|
227
|
+
}
|
|
228
|
+
/** Response from unified search endpoint */
|
|
229
|
+
export interface SearchResponse {
|
|
230
|
+
matches: SearchMatch[];
|
|
231
|
+
totalFound: number;
|
|
232
|
+
cacheHit: boolean;
|
|
233
|
+
}
|
|
234
|
+
/** Request to vote on a code snippet */
|
|
235
|
+
export interface VoteCodeSnipParams {
|
|
236
|
+
task: string;
|
|
237
|
+
codeBlockId: string;
|
|
238
|
+
codeBlockName: string;
|
|
239
|
+
codeBlockDescription: string;
|
|
240
|
+
succeeded: boolean;
|
|
241
|
+
}
|
|
242
|
+
/** Response from voting on a code snippet */
|
|
243
|
+
export interface VoteCodeSnipResponse {
|
|
244
|
+
success: boolean;
|
|
245
|
+
votePending: boolean;
|
|
246
|
+
message: string;
|
|
247
|
+
}
|
|
248
|
+
/** Request for auto-review by Claude */
|
|
249
|
+
export interface AutoReviewParams {
|
|
250
|
+
executionId: string;
|
|
251
|
+
triggeringTask: string;
|
|
252
|
+
executionState: ExecutionState;
|
|
253
|
+
inputData: Record<string, JsonValue>;
|
|
254
|
+
outputData: JsonValue;
|
|
255
|
+
codeBlockName: string;
|
|
256
|
+
codeBlockDescription: string;
|
|
257
|
+
errorMessage?: string | null;
|
|
258
|
+
}
|
|
259
|
+
/** Response with auto-generated review */
|
|
260
|
+
export interface AutoReviewResponse {
|
|
261
|
+
success: boolean;
|
|
262
|
+
executionId: string;
|
|
263
|
+
review: AgentReview;
|
|
264
|
+
message: string;
|
|
265
|
+
}
|
|
266
|
+
/** Request to retrieve executions */
|
|
267
|
+
export interface GetExecutionsParams {
|
|
268
|
+
codeBlockId?: string | null;
|
|
269
|
+
task?: string | null;
|
|
270
|
+
verdict?: AgentVerdict | null;
|
|
271
|
+
limit?: number;
|
|
272
|
+
}
|
|
273
|
+
/** Response with executions */
|
|
274
|
+
export interface RetrieveExecutionsResponse {
|
|
275
|
+
executions: ExecutionRecord[];
|
|
276
|
+
totalFound: number;
|
|
277
|
+
}
|
|
278
|
+
/** Options for uploadNewCodeSnip (kwargs-style) */
|
|
279
|
+
export interface UploadNewCodeSnipOptions {
|
|
280
|
+
task: string;
|
|
281
|
+
fileWritten?: FileWritten;
|
|
282
|
+
/** Compatibility alias for legacy wrappers that pass multiple files. */
|
|
283
|
+
filesWritten?: FileWritten[];
|
|
284
|
+
succeeded: boolean;
|
|
285
|
+
cachedCodeBlocks?: Array<{
|
|
286
|
+
codeBlockId: string;
|
|
287
|
+
filename: string;
|
|
288
|
+
description: string;
|
|
289
|
+
}>;
|
|
290
|
+
useRaysurferAiVoting?: boolean;
|
|
291
|
+
/** Compatibility alias for useRaysurferAiVoting. */
|
|
292
|
+
autoVote?: boolean;
|
|
293
|
+
userVote?: number;
|
|
294
|
+
executionLogs?: string;
|
|
295
|
+
runUrl?: string;
|
|
296
|
+
workspaceId?: string;
|
|
297
|
+
/** Package dependencies with versions (e.g., {"pandas": "2.1.0"}) */
|
|
298
|
+
dependencies?: Record<string, string>;
|
|
299
|
+
/** Upload to the public community namespace (default false) */
|
|
300
|
+
public?: boolean;
|
|
301
|
+
}
|
|
302
|
+
/** A public community snippet from the curated namespace */
|
|
303
|
+
export interface PublicSnippet {
|
|
304
|
+
id: string;
|
|
305
|
+
name: string;
|
|
306
|
+
description: string;
|
|
307
|
+
source: string;
|
|
308
|
+
language: string;
|
|
309
|
+
entrypoint: string;
|
|
310
|
+
thumbsUp: number;
|
|
311
|
+
thumbsDown: number;
|
|
312
|
+
createdAt: string | null;
|
|
313
|
+
namespace: string;
|
|
314
|
+
}
|
|
315
|
+
/** Response from browsing public snippets */
|
|
316
|
+
export interface BrowsePublicResponse {
|
|
317
|
+
snippets: PublicSnippet[];
|
|
318
|
+
total: number;
|
|
319
|
+
hasMore: boolean;
|
|
320
|
+
}
|
|
321
|
+
/** Response from searching public snippets */
|
|
322
|
+
export interface SearchPublicResponse {
|
|
323
|
+
snippets: PublicSnippet[];
|
|
324
|
+
total: number;
|
|
325
|
+
query: string;
|
|
326
|
+
}
|
|
327
|
+
/** Params for browsing public snippets */
|
|
328
|
+
export interface BrowsePublicParams {
|
|
329
|
+
limit?: number;
|
|
330
|
+
offset?: number;
|
|
331
|
+
sortBy?: "upvoted" | "recent";
|
|
332
|
+
language?: string;
|
|
333
|
+
}
|
|
334
|
+
/** Params for searching public snippets */
|
|
335
|
+
export interface SearchPublicParams {
|
|
336
|
+
query: string;
|
|
337
|
+
limit?: number;
|
|
338
|
+
language?: string;
|
|
339
|
+
}
|
|
340
|
+
/** Definition of a tool that can be called during execution */
|
|
341
|
+
export interface ToolDefinition {
|
|
342
|
+
name: string;
|
|
343
|
+
description: string;
|
|
344
|
+
parameters: Record<string, JsonValue>;
|
|
345
|
+
}
|
|
346
|
+
/** Callback function invoked when the server calls a tool */
|
|
347
|
+
export type ToolCallback = (args: Record<string, JsonValue>) => Promise<string> | string;
|
|
348
|
+
/** Options for the execute method */
|
|
349
|
+
export interface ExecuteOptions {
|
|
350
|
+
/** Timeout in milliseconds (default 300000 = 5 minutes) */
|
|
351
|
+
timeout: number;
|
|
352
|
+
/** Force regeneration instead of using cached code (default false) */
|
|
353
|
+
forceRegenerate: boolean;
|
|
354
|
+
}
|
|
355
|
+
/** Record of a single tool call made during execution */
|
|
356
|
+
export interface ToolCallRecord {
|
|
357
|
+
toolName: string;
|
|
358
|
+
arguments: Record<string, JsonValue>;
|
|
359
|
+
result: string | null;
|
|
360
|
+
error: string | null;
|
|
361
|
+
durationMs: number;
|
|
362
|
+
}
|
|
363
|
+
/** Result of an execute call */
|
|
364
|
+
export interface ExecuteResult {
|
|
365
|
+
executionId: string;
|
|
366
|
+
result: string | null;
|
|
367
|
+
exitCode: number;
|
|
368
|
+
durationMs: number;
|
|
369
|
+
cacheHit: boolean;
|
|
370
|
+
codeBlockId: string | null;
|
|
371
|
+
error: string | null;
|
|
372
|
+
toolCalls: ToolCallRecord[];
|
|
373
|
+
}
|
|
374
|
+
/** Options for uploadBulkCodeSnips (kwargs-style) */
|
|
375
|
+
export interface UploadBulkCodeSnipsOptions {
|
|
376
|
+
prompts: string[];
|
|
377
|
+
filesWritten: FileWritten[];
|
|
378
|
+
logFiles?: Array<LogFile | {
|
|
379
|
+
path: string;
|
|
380
|
+
content: string | Buffer;
|
|
381
|
+
encoding?: "utf-8" | "base64";
|
|
382
|
+
contentType?: string;
|
|
383
|
+
}>;
|
|
384
|
+
useRaysurferAiVoting?: boolean;
|
|
385
|
+
userVotes?: Record<string, number>;
|
|
386
|
+
workspaceId?: string;
|
|
387
|
+
}
|
|
388
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"A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