@builder.io/ai-utils 0.3.8 → 0.3.9
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/package.json +1 -1
- package/src/codegen.d.ts +440 -0
- package/src/codegen.js +1 -0
- package/src/completion.d.ts +154 -0
- package/src/completion.js +1 -0
- package/src/events.d.ts +369 -0
- package/src/events.js +1 -0
- package/src/index.js +6 -0
- package/src/mapping.d.ts +86 -0
- package/src/mapping.js +1 -0
- package/src/messages.d.ts +170 -0
- package/src/messages.js +16 -0
- package/src/settings.d.ts +20 -0
- package/src/settings.js +30 -0
- package/README.md +0 -3
- package/src/codegen.ts +0 -572
- package/src/completion.ts +0 -174
- package/src/events.ts +0 -474
- package/src/mapping.ts +0 -98
- package/src/messages.ts +0 -244
- package/src/settings.ts +0 -59
- /package/src/{index.ts → index.d.ts} +0 -0
package/README.md
DELETED
package/src/codegen.ts
DELETED
|
@@ -1,572 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Attachment,
|
|
3
|
-
ContentMessageItemToolResult,
|
|
4
|
-
UserMessageParam,
|
|
5
|
-
} from "./messages";
|
|
6
|
-
|
|
7
|
-
import type { BuilderContent } from "./completion";
|
|
8
|
-
|
|
9
|
-
import type { Options as PrettierOptions } from "prettier";
|
|
10
|
-
import type { UserContext } from "./mapping";
|
|
11
|
-
import type { AssistantMessageParam } from "./messages";
|
|
12
|
-
|
|
13
|
-
// Define the import type as a union of literal types.
|
|
14
|
-
export type ImportType = "named" | "default";
|
|
15
|
-
|
|
16
|
-
// Define an interface for the import descriptor.
|
|
17
|
-
export interface ESMImport {
|
|
18
|
-
importName: string; // e.g. "Button"
|
|
19
|
-
importPath: string; // e.g. "path"
|
|
20
|
-
importType: ImportType; // Either 'named' or 'default'
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface ProjectFile {
|
|
24
|
-
filePath: string;
|
|
25
|
-
content?: string;
|
|
26
|
-
importance?: number;
|
|
27
|
-
dropReason?: string;
|
|
28
|
-
wasIncluded?: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface CustomInstruction {
|
|
32
|
-
id: string;
|
|
33
|
-
name: string;
|
|
34
|
-
content: string;
|
|
35
|
-
type?: "always" | "agent-mode";
|
|
36
|
-
filePath?: string;
|
|
37
|
-
glob?: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type CodeGenFramework =
|
|
42
|
-
| "react"
|
|
43
|
-
| "html"
|
|
44
|
-
| "mitosis"
|
|
45
|
-
| "react-native"
|
|
46
|
-
| "angular"
|
|
47
|
-
| "vue"
|
|
48
|
-
| "svelte"
|
|
49
|
-
| "qwik"
|
|
50
|
-
| "solid"
|
|
51
|
-
| "marko"
|
|
52
|
-
| "swiftui"
|
|
53
|
-
| "jetpack-compose"
|
|
54
|
-
| "flutter";
|
|
55
|
-
|
|
56
|
-
export type CodeGenStyleLibrary =
|
|
57
|
-
| "tailwind"
|
|
58
|
-
| "tailwind-precise"
|
|
59
|
-
| "emotion"
|
|
60
|
-
| "styled-components"
|
|
61
|
-
| "styled-jsx"
|
|
62
|
-
| "react-native"
|
|
63
|
-
| undefined;
|
|
64
|
-
|
|
65
|
-
export type CompletionStopReason =
|
|
66
|
-
| "max_tokens"
|
|
67
|
-
| "stop_sequence"
|
|
68
|
-
| "tool_use"
|
|
69
|
-
| "end_turn"
|
|
70
|
-
| "content_filter"
|
|
71
|
-
| "error"
|
|
72
|
-
| "aborted"
|
|
73
|
-
| null;
|
|
74
|
-
|
|
75
|
-
export interface ViewPathToolInput {
|
|
76
|
-
filePath: string;
|
|
77
|
-
viewRange?: [number, number];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface GlobSearchToolInput {
|
|
81
|
-
pattern: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface GrepSearchToolInput {
|
|
85
|
-
query: string;
|
|
86
|
-
includeGlob?: string;
|
|
87
|
-
excludeGlob?: string;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface GetRuleToolInput {
|
|
91
|
-
name: string;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface DevServerControlInput {
|
|
95
|
-
restart?: boolean;
|
|
96
|
-
getLogs?: boolean;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface BashToolInput {
|
|
100
|
-
command?: string;
|
|
101
|
-
restart?: boolean;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface WebSearchToolInput {
|
|
105
|
-
query: string;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface CodeGenToolMap {
|
|
109
|
-
view_path: ViewPathToolInput;
|
|
110
|
-
glob_search: GlobSearchToolInput;
|
|
111
|
-
grep_search: GrepSearchToolInput;
|
|
112
|
-
get_rule: GetRuleToolInput;
|
|
113
|
-
dev_server_control: DevServerControlInput;
|
|
114
|
-
bash: BashToolInput;
|
|
115
|
-
web_search: WebSearchToolInput;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export type CodeGenTools = keyof CodeGenToolMap;
|
|
119
|
-
|
|
120
|
-
export type CodeGenMode =
|
|
121
|
-
| "exact" // @deprecated
|
|
122
|
-
| "precise" // tries to match the design as close
|
|
123
|
-
| "precise_vision" // tries to match the design as close, also uses vision to match
|
|
124
|
-
| "creative" // adapts the design to some generic design language
|
|
125
|
-
| "creative_vision" // adapts the design to some generic design language, also uses vision to match
|
|
126
|
-
| "creative_only_vision"; // adapts the design to some generic design language, but only uses vision to match
|
|
127
|
-
|
|
128
|
-
export interface CodeGenInputOptions {
|
|
129
|
-
position: string;
|
|
130
|
-
eventName?: string;
|
|
131
|
-
sessionId: string;
|
|
132
|
-
|
|
133
|
-
codeGenMode?: "fast" | "quality" | "quality-v3";
|
|
134
|
-
url?: string;
|
|
135
|
-
diffActions?: boolean;
|
|
136
|
-
planningPrompt?: boolean;
|
|
137
|
-
customInstructions?: CustomInstruction[];
|
|
138
|
-
userPrompt?: string;
|
|
139
|
-
ephemeralUserPrompt?: string;
|
|
140
|
-
displayUserPrompt?: string;
|
|
141
|
-
files?: ProjectFile[];
|
|
142
|
-
rerankFiles?: number;
|
|
143
|
-
toolResults?: ContentMessageItemToolResult[];
|
|
144
|
-
attachments?: Attachment[];
|
|
145
|
-
beforeCommit?: string;
|
|
146
|
-
workingDirectory?: string;
|
|
147
|
-
|
|
148
|
-
// Code options
|
|
149
|
-
builderContent?: BuilderContent;
|
|
150
|
-
framework?: CodeGenFramework;
|
|
151
|
-
styleLibrary?: CodeGenStyleLibrary;
|
|
152
|
-
typescript?: boolean;
|
|
153
|
-
userContext?: UserContext;
|
|
154
|
-
|
|
155
|
-
enabledTools?: CodeGenTools[];
|
|
156
|
-
|
|
157
|
-
// Options
|
|
158
|
-
maxTokens?: number;
|
|
159
|
-
maxPages?: number;
|
|
160
|
-
autoContinue?: number;
|
|
161
|
-
promptCaching?: boolean;
|
|
162
|
-
isAutoContinue?: boolean;
|
|
163
|
-
llmSuggestions?: boolean;
|
|
164
|
-
conclusionText?: boolean;
|
|
165
|
-
|
|
166
|
-
searchResponse?: any | null;
|
|
167
|
-
|
|
168
|
-
// Prettier options
|
|
169
|
-
prettierConfig?: PrettierOptions;
|
|
170
|
-
|
|
171
|
-
/** @deprecated */
|
|
172
|
-
history?: (UserMessageParam | AssistantMessageParam)[];
|
|
173
|
-
/** @deprecated */
|
|
174
|
-
prevId?: string;
|
|
175
|
-
/** @deprecated */
|
|
176
|
-
nextPage?: boolean;
|
|
177
|
-
/** @deprecated */
|
|
178
|
-
vcpId?: string;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export type Feature = "component-mapping";
|
|
182
|
-
|
|
183
|
-
export interface CodegenUsage {
|
|
184
|
-
total: number;
|
|
185
|
-
fast: number;
|
|
186
|
-
quality: number;
|
|
187
|
-
features: Feature[];
|
|
188
|
-
limits: {
|
|
189
|
-
aiGeneration: number;
|
|
190
|
-
aiGenerationContextWindow: number;
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export interface PromptSuggestion {
|
|
195
|
-
type:
|
|
196
|
-
| "missing-imports"
|
|
197
|
-
| "lazy-code"
|
|
198
|
-
| "no-file-for-diff"
|
|
199
|
-
| "syntax-error"
|
|
200
|
-
| "llm-suggested"
|
|
201
|
-
| "diff-apply";
|
|
202
|
-
|
|
203
|
-
filePath?: string;
|
|
204
|
-
line?: number;
|
|
205
|
-
importance: "high" | "medium" | "low";
|
|
206
|
-
column?: number;
|
|
207
|
-
summary: string;
|
|
208
|
-
prompt: string;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export interface ActionItem {
|
|
212
|
-
type:
|
|
213
|
-
| "file"
|
|
214
|
-
| "text"
|
|
215
|
-
| "diff"
|
|
216
|
-
| "thinking"
|
|
217
|
-
| "tool"
|
|
218
|
-
| "suggestion"
|
|
219
|
-
| "tool_result";
|
|
220
|
-
id?: string;
|
|
221
|
-
content: string;
|
|
222
|
-
filePath?: string;
|
|
223
|
-
artifactTitle?: string;
|
|
224
|
-
actionTitle?: string;
|
|
225
|
-
synthetic?: boolean;
|
|
226
|
-
incomplete?: boolean;
|
|
227
|
-
suggestions?: PromptSuggestion[];
|
|
228
|
-
errors?: string[];
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export interface RepoInfo {
|
|
232
|
-
remoteUrl: string;
|
|
233
|
-
defaultBranch: string;
|
|
234
|
-
currentBranch: string;
|
|
235
|
-
commit: string;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export interface CodebaseSearchOptions {
|
|
239
|
-
repoInfo?: RepoInfo;
|
|
240
|
-
query: string;
|
|
241
|
-
selectedFiles?: string[];
|
|
242
|
-
sessionId: string;
|
|
243
|
-
files?: string[];
|
|
244
|
-
packageJson?: string;
|
|
245
|
-
limit?: number;
|
|
246
|
-
includeContent?: boolean;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export interface CodebaseSearchResponse {
|
|
250
|
-
id: string;
|
|
251
|
-
relevantPaths: string[];
|
|
252
|
-
grepQueries: string[];
|
|
253
|
-
streamMeta: any;
|
|
254
|
-
ranked: RankedResult[];
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export interface RankedResult {
|
|
258
|
-
index: number;
|
|
259
|
-
filePath: string;
|
|
260
|
-
startIndex: number;
|
|
261
|
-
endIndex: number;
|
|
262
|
-
score: number;
|
|
263
|
-
id: string;
|
|
264
|
-
content?: string;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
export interface GenerateCompletionStepThinking {
|
|
268
|
-
type: "thinking";
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
export interface FileInfo {
|
|
272
|
-
filePath: string;
|
|
273
|
-
size: number;
|
|
274
|
-
isCustomInstruction: boolean;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export interface GenerateCompletionStepUserInput {
|
|
278
|
-
type: "user-input";
|
|
279
|
-
prompt: string;
|
|
280
|
-
files: FileInfo[];
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export interface GenerateCompletionStepToolResult {
|
|
284
|
-
type: "agent-input";
|
|
285
|
-
toolResults: ContentMessageItemToolResult[];
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
export interface GenerateCompletionStepPlanning {
|
|
289
|
-
type: "planning";
|
|
290
|
-
content: string;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
export interface GenerateCompletionStepUser {
|
|
294
|
-
type: "user";
|
|
295
|
-
displayPrompt: string | undefined;
|
|
296
|
-
id: string;
|
|
297
|
-
role: "user" | "agent";
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
export interface GenerateCompletionStepFile {
|
|
301
|
-
type: "file";
|
|
302
|
-
filePath: string;
|
|
303
|
-
content: string;
|
|
304
|
-
title: string;
|
|
305
|
-
id: string;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
export interface GenerateCompletionStepDiff {
|
|
309
|
-
type: "diff";
|
|
310
|
-
filePath: string;
|
|
311
|
-
content: string;
|
|
312
|
-
title: string;
|
|
313
|
-
id: string;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
export interface GenerateCompletionStepTool {
|
|
317
|
-
type: "tool";
|
|
318
|
-
name: string;
|
|
319
|
-
id: string;
|
|
320
|
-
content: string;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
export interface GenerateCompletionStepText {
|
|
324
|
-
type: "text";
|
|
325
|
-
content: string;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
export interface GenerateCompletionStepDone {
|
|
329
|
-
type: "done";
|
|
330
|
-
id: string;
|
|
331
|
-
applyResults: ApplyActionsResult[];
|
|
332
|
-
actions: ActionItem[];
|
|
333
|
-
usage: CodegenUsage | undefined;
|
|
334
|
-
url?: string;
|
|
335
|
-
stopReason: CompletionStopReason;
|
|
336
|
-
hasChanges: boolean;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
export interface GenerateCompletionStepStart {
|
|
340
|
-
type: "start";
|
|
341
|
-
name: string;
|
|
342
|
-
id: string | undefined;
|
|
343
|
-
title: string;
|
|
344
|
-
content: string;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
export interface GenerateCompletionStepDelta {
|
|
348
|
-
type: "delta";
|
|
349
|
-
name: string;
|
|
350
|
-
delta: string;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
export interface GenerateCompletionStepError {
|
|
354
|
-
type: "error";
|
|
355
|
-
id?: string;
|
|
356
|
-
stopReason?: "error" | "limit";
|
|
357
|
-
metadata?: any;
|
|
358
|
-
message: string;
|
|
359
|
-
usage?: CodegenUsage;
|
|
360
|
-
contextPrompt?: string;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
export interface GenerateCompletionStepContinue {
|
|
364
|
-
type: "continue";
|
|
365
|
-
id: string;
|
|
366
|
-
url: string;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
export interface GenerateCompletionStepWaitForInput {
|
|
370
|
-
type: "wait-for-input";
|
|
371
|
-
state: GenerateCompletionState;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
export interface GenerateCompletionStepAbort {
|
|
375
|
-
type: "user-abort";
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
export interface GenerateCompletionStepRestore {
|
|
379
|
-
type: "restore";
|
|
380
|
-
location: "before" | "after";
|
|
381
|
-
files: string[];
|
|
382
|
-
lastCompletionId: string | undefined;
|
|
383
|
-
commitHash: string | undefined;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export type GenerateCompletionState =
|
|
387
|
-
| "unknown"
|
|
388
|
-
| "initial-with-url"
|
|
389
|
-
| "initial-without-url"
|
|
390
|
-
| "generating"
|
|
391
|
-
| "success"
|
|
392
|
-
| "abort"
|
|
393
|
-
| "error"
|
|
394
|
-
| "close";
|
|
395
|
-
|
|
396
|
-
export interface GenerateCompletionStepState {
|
|
397
|
-
type: "state";
|
|
398
|
-
previousState: GenerateCompletionState;
|
|
399
|
-
newState: GenerateCompletionState;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
export interface GenerateCompletionStepClose {
|
|
403
|
-
type: "close";
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
export interface GenerateCompletionStepStdio {
|
|
407
|
-
type: "stdio";
|
|
408
|
-
command: string;
|
|
409
|
-
stream: "stdout" | "stderr";
|
|
410
|
-
source: "run-command" | "tool-command";
|
|
411
|
-
content: string;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
export interface GenerateCompletionStepSession {
|
|
415
|
-
type: "session";
|
|
416
|
-
title: string | undefined;
|
|
417
|
-
beforeCommit: string | undefined;
|
|
418
|
-
createdUnixTime: number;
|
|
419
|
-
updatedUnixTime: number;
|
|
420
|
-
id: string;
|
|
421
|
-
hasChanges: boolean;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
export type GenerateCompletionStep = { timestamp?: number } & (
|
|
425
|
-
| GenerateCompletionStepPlanning
|
|
426
|
-
| GenerateCompletionStepStart
|
|
427
|
-
| GenerateCompletionStepDelta
|
|
428
|
-
| GenerateCompletionStepUser
|
|
429
|
-
| GenerateCompletionStepFile
|
|
430
|
-
| GenerateCompletionStepDiff
|
|
431
|
-
| GenerateCompletionStepTool
|
|
432
|
-
| GenerateCompletionStepError
|
|
433
|
-
| GenerateCompletionStepContinue
|
|
434
|
-
| GenerateCompletionStepWaitForInput
|
|
435
|
-
| GenerateCompletionStepAbort
|
|
436
|
-
| GenerateCompletionStepDone
|
|
437
|
-
| GenerateCompletionStepUserInput
|
|
438
|
-
| GenerateCompletionStepText
|
|
439
|
-
| GenerateCompletionStepRestore
|
|
440
|
-
| GenerateCompletionStepState
|
|
441
|
-
| GenerateCompletionStepStdio
|
|
442
|
-
| GenerateCompletionStepSession
|
|
443
|
-
| GenerateCompletionStepToolResult
|
|
444
|
-
);
|
|
445
|
-
|
|
446
|
-
export interface ApplyActionsResult {
|
|
447
|
-
filePath: string;
|
|
448
|
-
addedLines: number;
|
|
449
|
-
removedLines: number;
|
|
450
|
-
action: "create" | "update" | "delete";
|
|
451
|
-
content?: string;
|
|
452
|
-
oldContent?: string;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
export interface GenerateUserMessage {
|
|
456
|
-
userPrompt: string;
|
|
457
|
-
ephemeralUserPrompt?: string;
|
|
458
|
-
displayPrompt?: string;
|
|
459
|
-
files?: string[];
|
|
460
|
-
includeBaseFiles?: boolean;
|
|
461
|
-
skipSearch?: boolean;
|
|
462
|
-
attachments?: Attachment[];
|
|
463
|
-
debugMode?: boolean;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
export interface UserInput {
|
|
467
|
-
userMessage: GenerateUserMessage | undefined;
|
|
468
|
-
userPrompt: string;
|
|
469
|
-
attachments: Attachment[];
|
|
470
|
-
files: ProjectFile[];
|
|
471
|
-
searchResponse: CodebaseSearchResponse | null;
|
|
472
|
-
rerankFiles?: number;
|
|
473
|
-
mostRelevantFile: string | null;
|
|
474
|
-
toolResults: ContentMessageItemToolResult[];
|
|
475
|
-
role: "user" | "agent";
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
export interface CodegenTurn {
|
|
479
|
-
state: "running" | "done" | "error" | "aborted" | "reverted";
|
|
480
|
-
unixTime: number;
|
|
481
|
-
completionId: string;
|
|
482
|
-
title: string;
|
|
483
|
-
nextUrl: string | undefined;
|
|
484
|
-
role: "user" | "agent";
|
|
485
|
-
actions: ActionItem[];
|
|
486
|
-
sentiment: "positive" | "negative" | "undo" | undefined;
|
|
487
|
-
applyResults: ApplyActionsResult[];
|
|
488
|
-
userMessage: GenerateUserMessage | undefined;
|
|
489
|
-
beforeCommit: string | undefined;
|
|
490
|
-
afterCommit: string | undefined;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
export interface GetSessionTurnsResult {
|
|
494
|
-
turns: CodegenTurn[];
|
|
495
|
-
sessionId: string;
|
|
496
|
-
initialUrl: string | undefined;
|
|
497
|
-
beforeCommit: string | undefined;
|
|
498
|
-
title: string | undefined;
|
|
499
|
-
createdUnixTime: number | undefined;
|
|
500
|
-
updatedUnixTime: number | undefined;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
export interface CodegenFeedback {
|
|
504
|
-
id: string;
|
|
505
|
-
feedbackText?: string;
|
|
506
|
-
feedbackSentiment?: string;
|
|
507
|
-
framework?: string;
|
|
508
|
-
acceptedLines?: number;
|
|
509
|
-
afterCommit?: string;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
export interface CodegenSetLastCompletion {
|
|
513
|
-
sessionId: string;
|
|
514
|
-
lastCompletionId: string | undefined;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
export interface GenerateCodeEventDone {
|
|
518
|
-
type: "done";
|
|
519
|
-
unixTime: number;
|
|
520
|
-
stopReason: CompletionStopReason;
|
|
521
|
-
id: string;
|
|
522
|
-
actionTitle: string;
|
|
523
|
-
content?: string;
|
|
524
|
-
needsPagination: boolean;
|
|
525
|
-
actions?: ActionItem[];
|
|
526
|
-
suggestions: PromptSuggestion[];
|
|
527
|
-
usage?: CodegenUsage;
|
|
528
|
-
messageIndex: number;
|
|
529
|
-
sessionUsage: number;
|
|
530
|
-
nextUrl: string;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
export interface GenerateCodeEventError {
|
|
534
|
-
type: "error";
|
|
535
|
-
stopReason: "error" | "limit";
|
|
536
|
-
id: string;
|
|
537
|
-
message: string;
|
|
538
|
-
usage?: CodegenUsage;
|
|
539
|
-
}
|
|
540
|
-
export interface GenerateCodeEventPagination {
|
|
541
|
-
type: "pagination";
|
|
542
|
-
pop: number;
|
|
543
|
-
page: number;
|
|
544
|
-
id: string;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
export interface GenerateCodeEventContinue {
|
|
548
|
-
type: "continue";
|
|
549
|
-
id: string;
|
|
550
|
-
nextUrl: string;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
export interface GenerateCodeEventDelta {
|
|
554
|
-
type: "delta";
|
|
555
|
-
content: string;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
export interface GenerateCodeEventUser {
|
|
559
|
-
type: "user";
|
|
560
|
-
id: string;
|
|
561
|
-
displayPrompt: string | undefined;
|
|
562
|
-
role: "user" | "agent";
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
export type GenerateCodeEvent =
|
|
566
|
-
| ActionItem
|
|
567
|
-
| GenerateCodeEventDone
|
|
568
|
-
| GenerateCodeEventContinue
|
|
569
|
-
| GenerateCodeEventPagination
|
|
570
|
-
| GenerateCodeEventDelta
|
|
571
|
-
| GenerateCodeEventError
|
|
572
|
-
| GenerateCodeEventUser;
|