@lovable.dev/sdk 0.1.3 → 0.1.5
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 +6 -3
- package/dist/index.d.ts +393 -17
- package/dist/index.js +341 -45
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -113,7 +113,7 @@ The `continuation` option on `chat()` overrides prompt cache reuse behavior. API
|
|
|
113
113
|
|
|
114
114
|
### Using a custom model
|
|
115
115
|
|
|
116
|
-
You can route the main agent to a custom OpenAI-compatible endpoint for
|
|
116
|
+
You can route the main agent to a custom OpenAI-compatible endpoint (for example your own inference base URL):
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
119
|
await client.chat(project.id, {
|
|
@@ -121,11 +121,13 @@ await client.chat(project.id, {
|
|
|
121
121
|
customModel: {
|
|
122
122
|
endpoint: "https://my-vllm.example.com/v1",
|
|
123
123
|
apiKey: "sk-...",
|
|
124
|
-
modelName: "
|
|
124
|
+
modelName: "my-org/my-model-id",
|
|
125
125
|
},
|
|
126
126
|
});
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
+
Optional `customModelDisableRace` on `chat()` (JSON field `custom_model_disable_race`) skips staggered inference racing when the server supports it for your endpoint. Requires API-key authentication, same as other custom-model fields.
|
|
130
|
+
|
|
129
131
|
### Fetching message traces (`_dev`)
|
|
130
132
|
|
|
131
133
|
Trace APIs are available under the `_dev` namespace. These are not part of the stable v1 surface and may change without notice.
|
|
@@ -224,6 +226,7 @@ Options:
|
|
|
224
226
|
- `files` (optional): Array of files to attach (browser `File` objects or `FileInput` objects)
|
|
225
227
|
- `chatOnly` (optional): If true, only chat without making code changes
|
|
226
228
|
- `customModel` (optional): Route the main agent to a custom OpenAI-compatible endpoint (see `CustomModelConfig`)
|
|
229
|
+
- `customModelDisableRace` (optional): Skip staggered inference racing for allowlisted custom model hosts (JSON `custom_model_disable_race`). API-key auth only; see [Using a custom model](#using-a-custom-model)
|
|
227
230
|
- `continuation` (optional): Override prompt cache continuation behavior (`"force"` | `"fresh_build"` | `"allow_expired_cache"`). API-key auth only. See [Controlling prompt cache continuation](#controlling-prompt-cache-continuation)
|
|
228
231
|
|
|
229
232
|
Note: This is an asynchronous operation. The API accepts the message and processes it in the background. Use `waitForResponse()` to wait for the AI's reply.
|
|
@@ -432,7 +435,7 @@ Configuration for routing the main agent to a custom OpenAI-compatible endpoint:
|
|
|
432
435
|
interface CustomModelConfig {
|
|
433
436
|
endpoint: string; // Base URL (e.g., "https://my-vllm.example.com/v1")
|
|
434
437
|
apiKey: string; // API key for the endpoint
|
|
435
|
-
modelName: string; // Model identifier (e.g., "
|
|
438
|
+
modelName: string; // Model identifier (e.g., "my-org/my-model-id")
|
|
436
439
|
}
|
|
437
440
|
```
|
|
438
441
|
|
package/dist/index.d.ts
CHANGED
|
@@ -93,6 +93,8 @@ interface ProjectResponse {
|
|
|
93
93
|
visibility?: ProjectVisibility;
|
|
94
94
|
publish_visibility?: "private" | "public";
|
|
95
95
|
is_published?: boolean;
|
|
96
|
+
/** Present in create project response when initial_message was provided */
|
|
97
|
+
message_id?: string;
|
|
96
98
|
is_starred?: boolean;
|
|
97
99
|
is_template?: boolean;
|
|
98
100
|
is_github?: boolean;
|
|
@@ -147,15 +149,13 @@ interface FileInput {
|
|
|
147
149
|
}
|
|
148
150
|
/**
|
|
149
151
|
* Configuration to use a custom OpenAI-compatible model as the main agent.
|
|
150
|
-
* Enables eval and RL workflows where candidate models are benchmarked
|
|
151
|
-
* against the full Lovable agent pipeline.
|
|
152
152
|
*/
|
|
153
153
|
interface CustomModelConfig {
|
|
154
154
|
/** Base URL of the OpenAI-compatible API (e.g. "https://my-vllm.example.com/v1") */
|
|
155
155
|
endpoint: string;
|
|
156
156
|
/** API key for the custom endpoint */
|
|
157
157
|
apiKey: string;
|
|
158
|
-
/** Model identifier sent in the request (e.g. "
|
|
158
|
+
/** Model identifier sent in the request (e.g. "my-org/my-model-id") */
|
|
159
159
|
modelName: string;
|
|
160
160
|
}
|
|
161
161
|
interface ChatRequest {
|
|
@@ -176,6 +176,7 @@ interface ChatRequest {
|
|
|
176
176
|
custom_model_endpoint?: string;
|
|
177
177
|
custom_model_api_key?: string;
|
|
178
178
|
custom_model_name?: string;
|
|
179
|
+
custom_model_disable_race?: boolean;
|
|
179
180
|
}
|
|
180
181
|
interface CreateProjectBody {
|
|
181
182
|
description: string;
|
|
@@ -183,6 +184,10 @@ interface CreateProjectBody {
|
|
|
183
184
|
visibility?: ProjectVisibility;
|
|
184
185
|
template_project_id?: string;
|
|
185
186
|
initial_message?: string;
|
|
187
|
+
files?: UnscopedFile[];
|
|
188
|
+
selected_libraries?: {
|
|
189
|
+
project_id: string;
|
|
190
|
+
}[];
|
|
186
191
|
category?: string;
|
|
187
192
|
project_type?: string;
|
|
188
193
|
prompt_name?: string;
|
|
@@ -200,7 +205,14 @@ interface CreateProjectOptions {
|
|
|
200
205
|
visibility?: ProjectVisibility;
|
|
201
206
|
templateProjectId?: string;
|
|
202
207
|
initialMessage?: string;
|
|
208
|
+
/** Files to upload and attach to the initial message. The SDK handles uploading. */
|
|
203
209
|
files?: (File | FileInput)[];
|
|
210
|
+
/** Pre-uploaded file references to attach to the initial message. Skips upload. */
|
|
211
|
+
uploadedFiles?: UnscopedFile[];
|
|
212
|
+
/** Design system library projects to connect to the new project. */
|
|
213
|
+
selectedLibraries?: {
|
|
214
|
+
project_id: string;
|
|
215
|
+
}[];
|
|
204
216
|
}
|
|
205
217
|
interface InviteCollaboratorOptions {
|
|
206
218
|
email: string;
|
|
@@ -218,9 +230,19 @@ interface InviteCollaboratorOptions {
|
|
|
218
230
|
type ContinuationOverride = "force" | "fresh_build" | "allow_expired_cache";
|
|
219
231
|
interface ChatMessageOptions {
|
|
220
232
|
message: string;
|
|
233
|
+
/** Files to upload and attach. The SDK handles uploading them first. */
|
|
221
234
|
files?: (File | FileInput)[];
|
|
222
|
-
|
|
235
|
+
/** Pre-uploaded file references (already uploaded via getFileUploadUrl). Skips upload. */
|
|
236
|
+
uploadedFiles?: UnscopedFile[];
|
|
237
|
+
/** Enable plan mode: the agent discusses and plans without editing code. */
|
|
238
|
+
planMode?: boolean;
|
|
223
239
|
customModel?: CustomModelConfig;
|
|
240
|
+
/**
|
|
241
|
+
* When true, the server may skip staggered inference racing for that request if your
|
|
242
|
+
* custom model endpoint supports it; otherwise the request fails with a validation error.
|
|
243
|
+
* API key authentication only. Sent as `custom_model_disable_race` in the JSON body.
|
|
244
|
+
*/
|
|
245
|
+
customModelDisableRace?: boolean;
|
|
224
246
|
/**
|
|
225
247
|
* Override continuation behavior for this message.
|
|
226
248
|
* Controls whether the agent reuses the prompt cache or rebuilds from scratch.
|
|
@@ -228,8 +250,13 @@ interface ChatMessageOptions {
|
|
|
228
250
|
continuation?: ContinuationOverride;
|
|
229
251
|
}
|
|
230
252
|
interface LovableClientOptions {
|
|
231
|
-
|
|
253
|
+
/** API key for authentication (mutually exclusive with bearerToken) */
|
|
254
|
+
apiKey?: string;
|
|
255
|
+
/** Bearer token for OAuth authentication (mutually exclusive with apiKey) */
|
|
256
|
+
bearerToken?: string;
|
|
232
257
|
baseUrl?: string;
|
|
258
|
+
/** Additional headers to include on every request */
|
|
259
|
+
headers?: Record<string, string>;
|
|
233
260
|
}
|
|
234
261
|
interface LovableError extends Error {
|
|
235
262
|
status: number;
|
|
@@ -343,6 +370,7 @@ interface RemixProjectOptions {
|
|
|
343
370
|
includeHistory?: boolean;
|
|
344
371
|
includeCustomKnowledge?: boolean;
|
|
345
372
|
initialMessage?: string;
|
|
373
|
+
projectName?: string;
|
|
346
374
|
skipInitialRemixMessage?: boolean;
|
|
347
375
|
skipIntegrations?: boolean;
|
|
348
376
|
/** Copy agent continuation state so prompt cache can be reused after remix. Requires includeHistory. API-key auth only. */
|
|
@@ -376,12 +404,259 @@ interface DatabaseConnectionInfo {
|
|
|
376
404
|
connection_string: string;
|
|
377
405
|
api_url: string;
|
|
378
406
|
}
|
|
407
|
+
declare class ApiError extends Error {
|
|
408
|
+
readonly status: number;
|
|
409
|
+
readonly type?: string;
|
|
410
|
+
readonly detail?: string;
|
|
411
|
+
constructor(status: number, message: string, type?: string, detail?: string);
|
|
412
|
+
}
|
|
413
|
+
interface SendMessageResponse {
|
|
414
|
+
message_id: string;
|
|
415
|
+
status: string;
|
|
416
|
+
}
|
|
417
|
+
interface GetMessageResponse {
|
|
418
|
+
message_id: string;
|
|
419
|
+
role: string;
|
|
420
|
+
content: string;
|
|
421
|
+
status: string;
|
|
422
|
+
created_at: string;
|
|
423
|
+
edit_id?: string;
|
|
424
|
+
commit_sha?: string;
|
|
425
|
+
summary?: string;
|
|
426
|
+
cost_credits?: number;
|
|
427
|
+
response?: {
|
|
428
|
+
message_id: string;
|
|
429
|
+
status: string;
|
|
430
|
+
content: string;
|
|
431
|
+
edit_id?: string;
|
|
432
|
+
commit_sha?: string;
|
|
433
|
+
summary?: string;
|
|
434
|
+
cost_credits?: number;
|
|
435
|
+
};
|
|
436
|
+
queue_position?: number;
|
|
437
|
+
queue_paused?: boolean;
|
|
438
|
+
queue_pause_reason?: string;
|
|
439
|
+
}
|
|
440
|
+
interface MessageCompletionResult {
|
|
441
|
+
status: "completed" | "timeout" | "error";
|
|
442
|
+
message_id: string;
|
|
443
|
+
content: string;
|
|
444
|
+
edit_id?: string;
|
|
445
|
+
commit_sha?: string;
|
|
446
|
+
summary?: string;
|
|
447
|
+
cost_credits?: number;
|
|
448
|
+
error?: string;
|
|
449
|
+
}
|
|
450
|
+
interface MessageCompletionOptions {
|
|
451
|
+
/** Time between polls in ms (default: 3000) */
|
|
452
|
+
pollInterval?: number;
|
|
453
|
+
/** Maximum time to wait in ms (default: 600000 = 10 minutes) */
|
|
454
|
+
timeout?: number;
|
|
455
|
+
}
|
|
456
|
+
interface KnowledgeResponse {
|
|
457
|
+
content: string;
|
|
458
|
+
}
|
|
459
|
+
interface FileUploadUrlResponse {
|
|
460
|
+
url: string;
|
|
461
|
+
file_id: string;
|
|
462
|
+
}
|
|
463
|
+
interface DiffLine {
|
|
464
|
+
type: string;
|
|
465
|
+
content: string;
|
|
466
|
+
}
|
|
467
|
+
interface DiffHunk {
|
|
468
|
+
oldStart: number;
|
|
469
|
+
oldCount: number;
|
|
470
|
+
newStart: number;
|
|
471
|
+
newCount: number;
|
|
472
|
+
lines: DiffLine[];
|
|
473
|
+
}
|
|
474
|
+
interface DiffEntry {
|
|
475
|
+
action: string;
|
|
476
|
+
file_path: string;
|
|
477
|
+
original_file_path?: string;
|
|
478
|
+
file_type?: string;
|
|
479
|
+
is_image: boolean;
|
|
480
|
+
is_incomplete?: boolean;
|
|
481
|
+
hunks?: DiffHunk[];
|
|
482
|
+
}
|
|
483
|
+
interface GitDiffResponse {
|
|
484
|
+
diffs: DiffEntry[];
|
|
485
|
+
error?: string;
|
|
486
|
+
}
|
|
487
|
+
interface GitFileEntry {
|
|
488
|
+
path: string;
|
|
489
|
+
size: number;
|
|
490
|
+
binary: boolean;
|
|
491
|
+
}
|
|
492
|
+
interface GitFilesResponse {
|
|
493
|
+
files: GitFileEntry[];
|
|
494
|
+
ref: string;
|
|
495
|
+
}
|
|
496
|
+
interface EditSummary {
|
|
497
|
+
id: string;
|
|
498
|
+
type: string;
|
|
499
|
+
commit_sha?: string;
|
|
500
|
+
commit_message?: string;
|
|
501
|
+
status: string;
|
|
502
|
+
created_at: string;
|
|
503
|
+
}
|
|
504
|
+
interface EditsResponse {
|
|
505
|
+
edits: EditSummary[];
|
|
506
|
+
has_more: boolean;
|
|
507
|
+
}
|
|
508
|
+
interface ListProjectItem extends ProjectResponse {
|
|
509
|
+
user_id?: string;
|
|
510
|
+
is_template?: boolean;
|
|
511
|
+
is_starred?: boolean;
|
|
512
|
+
created_at?: string;
|
|
513
|
+
updated_at?: string;
|
|
514
|
+
last_edited_at?: string;
|
|
515
|
+
last_viewed_at?: string;
|
|
516
|
+
edit_count?: number;
|
|
517
|
+
remix_count?: number;
|
|
518
|
+
}
|
|
519
|
+
interface ListProjectsResponse {
|
|
520
|
+
projects: ListProjectItem[];
|
|
521
|
+
total: number;
|
|
522
|
+
has_more: boolean;
|
|
523
|
+
}
|
|
524
|
+
interface ListProjectsOptions {
|
|
525
|
+
query?: string;
|
|
526
|
+
visibility?: string;
|
|
527
|
+
publish_status?: string;
|
|
528
|
+
folder_id?: string;
|
|
529
|
+
user_id?: string;
|
|
530
|
+
sort_by?: string;
|
|
531
|
+
sort_order?: string;
|
|
532
|
+
viewed_by_me?: boolean;
|
|
533
|
+
limit?: number;
|
|
534
|
+
offset?: number;
|
|
535
|
+
cursor?: string;
|
|
536
|
+
}
|
|
537
|
+
interface LibraryProjectResponse {
|
|
538
|
+
id: string;
|
|
539
|
+
name: string | null;
|
|
540
|
+
description: string;
|
|
541
|
+
updated_at: string;
|
|
542
|
+
}
|
|
543
|
+
interface TemplateProjectResponse {
|
|
544
|
+
id: string;
|
|
545
|
+
name: string | null;
|
|
546
|
+
description: string;
|
|
547
|
+
updated_at: string;
|
|
548
|
+
}
|
|
549
|
+
interface MCPServerResponse {
|
|
550
|
+
id: string;
|
|
551
|
+
name: string;
|
|
552
|
+
url?: string;
|
|
553
|
+
auth_type: string;
|
|
554
|
+
connector_id?: string;
|
|
555
|
+
is_connected: boolean;
|
|
556
|
+
}
|
|
557
|
+
interface MCPCatalogEntry {
|
|
558
|
+
id: string;
|
|
559
|
+
display_name: string;
|
|
560
|
+
summary: string;
|
|
561
|
+
category: string;
|
|
562
|
+
requires_custom_url?: boolean;
|
|
563
|
+
documentation_url?: string;
|
|
564
|
+
}
|
|
565
|
+
interface AddMCPServerBody {
|
|
566
|
+
name: string;
|
|
567
|
+
url: string;
|
|
568
|
+
auth_type: "none" | "bearer_token";
|
|
569
|
+
connector_id?: string;
|
|
570
|
+
token?: string;
|
|
571
|
+
}
|
|
572
|
+
interface StandardConnectorItem {
|
|
573
|
+
id: string;
|
|
574
|
+
display_name: string;
|
|
575
|
+
short_description: string;
|
|
576
|
+
categories: string[];
|
|
577
|
+
is_enabled_for_workspace: boolean;
|
|
578
|
+
auth_type: string;
|
|
579
|
+
logo_id?: string;
|
|
580
|
+
documentation_url?: string;
|
|
581
|
+
connection_scope?: string;
|
|
582
|
+
}
|
|
583
|
+
interface SeamlessConnectorItem {
|
|
584
|
+
id: string;
|
|
585
|
+
display_name: string;
|
|
586
|
+
short_description: string;
|
|
587
|
+
categories: string[];
|
|
588
|
+
is_enabled_for_workspace: boolean;
|
|
589
|
+
logo_id?: string;
|
|
590
|
+
documentation_url?: string;
|
|
591
|
+
}
|
|
592
|
+
interface MCPConnectorItem {
|
|
593
|
+
id: string;
|
|
594
|
+
display_name: string;
|
|
595
|
+
summary: string;
|
|
596
|
+
status: string;
|
|
597
|
+
is_enabled_for_workspace: boolean;
|
|
598
|
+
is_connected: boolean;
|
|
599
|
+
connector_id?: string;
|
|
600
|
+
documentation_url?: string;
|
|
601
|
+
}
|
|
602
|
+
interface ConnectionItem {
|
|
603
|
+
id: string;
|
|
604
|
+
connector_id: string;
|
|
605
|
+
display_name: string;
|
|
606
|
+
is_managed: boolean;
|
|
607
|
+
status: string;
|
|
608
|
+
created_at: string;
|
|
609
|
+
updated_at: string;
|
|
610
|
+
}
|
|
611
|
+
interface TimeSeriesDataPoint {
|
|
612
|
+
date: string;
|
|
613
|
+
value: number;
|
|
614
|
+
}
|
|
615
|
+
interface TimeSeriesData {
|
|
616
|
+
total: number;
|
|
617
|
+
label: string;
|
|
618
|
+
data: TimeSeriesDataPoint[];
|
|
619
|
+
}
|
|
620
|
+
interface ListDataPoint {
|
|
621
|
+
label: string;
|
|
622
|
+
value: number;
|
|
623
|
+
}
|
|
624
|
+
interface ListData {
|
|
625
|
+
label: string;
|
|
626
|
+
data: ListDataPoint[];
|
|
627
|
+
}
|
|
628
|
+
interface ProjectAnalyticsResponse {
|
|
629
|
+
timeSeries: {
|
|
630
|
+
visitors: TimeSeriesData;
|
|
631
|
+
pageviews: TimeSeriesData;
|
|
632
|
+
pageviewsPerVisit: TimeSeriesData;
|
|
633
|
+
sessionDuration: TimeSeriesData;
|
|
634
|
+
bounceRate: TimeSeriesData;
|
|
635
|
+
};
|
|
636
|
+
lists: {
|
|
637
|
+
page: ListData;
|
|
638
|
+
source: ListData;
|
|
639
|
+
device: ListData;
|
|
640
|
+
country: ListData;
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
interface TrendDataPoint {
|
|
644
|
+
time: string;
|
|
645
|
+
visits: number;
|
|
646
|
+
}
|
|
647
|
+
interface ProjectAnalyticsTrendResponse {
|
|
648
|
+
data: TrendDataPoint[];
|
|
649
|
+
currentVisitors: number;
|
|
650
|
+
}
|
|
379
651
|
|
|
380
652
|
declare class LovableClient {
|
|
381
|
-
private readonly
|
|
653
|
+
private readonly authHeaders;
|
|
382
654
|
private readonly baseUrl;
|
|
655
|
+
private readonly extraHeaders;
|
|
383
656
|
constructor(options: LovableClientOptions);
|
|
657
|
+
private rawRequest;
|
|
384
658
|
private request;
|
|
659
|
+
private requestText;
|
|
385
660
|
/**
|
|
386
661
|
* Get the current authenticated user and their workspaces.
|
|
387
662
|
* Useful for validating an API key and discovering workspace IDs.
|
|
@@ -396,24 +671,23 @@ declare class LovableClient {
|
|
|
396
671
|
*/
|
|
397
672
|
getWorkspace(workspaceId: string): Promise<WorkspaceWithMembership>;
|
|
398
673
|
/**
|
|
399
|
-
* List projects in a workspace
|
|
674
|
+
* List projects in a workspace.
|
|
675
|
+
* Supports full-text search, filtering by visibility/publish status/folder/creator,
|
|
676
|
+
* and pagination via offset or cursor.
|
|
400
677
|
*/
|
|
401
|
-
listProjects(workspaceId: string, options?:
|
|
402
|
-
limit?: number;
|
|
403
|
-
cursor?: string;
|
|
404
|
-
visibility?: "all" | "draft" | "personal" | "private" | "public" | "workspace";
|
|
405
|
-
}): Promise<ProjectResponse[]>;
|
|
678
|
+
listProjects(workspaceId: string, options?: ListProjectsOptions): Promise<ListProjectsResponse>;
|
|
406
679
|
/**
|
|
407
680
|
* Create a new project in a workspace
|
|
408
681
|
*/
|
|
409
682
|
createProject(workspaceId: string, options: CreateProjectOptions): Promise<ProjectResponse>;
|
|
410
683
|
/**
|
|
411
|
-
* Send a chat message to a project
|
|
684
|
+
* Send a chat message to a project.
|
|
412
685
|
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
686
|
+
* The API accepts the message and processes it in the background.
|
|
687
|
+
* Returns the message ID and status. Use `waitForMessageCompletion()`
|
|
688
|
+
* to poll for the AI response, or `waitForResponse()` for SSE streaming.
|
|
415
689
|
*/
|
|
416
|
-
chat(projectId: string, options: ChatMessageOptions): Promise<
|
|
690
|
+
chat(projectId: string, options: ChatMessageOptions): Promise<SendMessageResponse>;
|
|
417
691
|
/**
|
|
418
692
|
* Invite a user to a workspace as a collaborator
|
|
419
693
|
*/
|
|
@@ -488,6 +762,108 @@ declare class LovableClient {
|
|
|
488
762
|
* @returns Database connection details
|
|
489
763
|
*/
|
|
490
764
|
getDatabaseConnectionInfo(projectId: string): Promise<DatabaseConnectionInfo>;
|
|
765
|
+
/**
|
|
766
|
+
* Get a message by ID. Returns the message content, status, and (for user messages)
|
|
767
|
+
* the AI response if available. Use to poll for completion after `chat()`.
|
|
768
|
+
*/
|
|
769
|
+
getMessage(projectId: string, messageId: string): Promise<GetMessageResponse>;
|
|
770
|
+
/**
|
|
771
|
+
* Poll for message completion. Waits until the AI response reaches a terminal
|
|
772
|
+
* status (completed, stopped) or the timeout expires.
|
|
773
|
+
*
|
|
774
|
+
* Handles edge cases: 404 grace period for race conditions between queue
|
|
775
|
+
* dequeue and event creation, and queue pause detection.
|
|
776
|
+
*/
|
|
777
|
+
waitForMessageCompletion(projectId: string, messageId: string, options?: MessageCompletionOptions): Promise<MessageCompletionResult>;
|
|
778
|
+
/** Get workspace knowledge (custom instructions for the AI agent). */
|
|
779
|
+
getWorkspaceKnowledge(workspaceId: string): Promise<KnowledgeResponse>;
|
|
780
|
+
/** Set workspace knowledge. Max 10,000 characters. */
|
|
781
|
+
setWorkspaceKnowledge(workspaceId: string, content: string): Promise<KnowledgeResponse>;
|
|
782
|
+
/** Get project knowledge (custom instructions for the AI agent). */
|
|
783
|
+
getProjectKnowledge(projectId: string): Promise<KnowledgeResponse>;
|
|
784
|
+
/** Set project knowledge. Max 10,000 characters. */
|
|
785
|
+
setProjectKnowledge(projectId: string, content: string): Promise<KnowledgeResponse>;
|
|
786
|
+
/**
|
|
787
|
+
* Get the structured diff for a message or commit.
|
|
788
|
+
* Pass `messageId` to get the diff for a specific AI message,
|
|
789
|
+
* or `sha` for a specific commit.
|
|
790
|
+
*/
|
|
791
|
+
getDiff(projectId: string, params: {
|
|
792
|
+
messageId?: string;
|
|
793
|
+
sha?: string;
|
|
794
|
+
baseSha?: string;
|
|
795
|
+
}): Promise<GitDiffResponse>;
|
|
796
|
+
/** List all files in a project at a specific git ref. */
|
|
797
|
+
listFiles(projectId: string, ref: string): Promise<GitFilesResponse>;
|
|
798
|
+
/** Read the raw content of a single file at a specific git ref. Returns text. */
|
|
799
|
+
readFile(projectId: string, path: string, ref: string): Promise<string>;
|
|
800
|
+
/** List the edit history of a project. */
|
|
801
|
+
listEdits(projectId: string, params?: {
|
|
802
|
+
limit?: number;
|
|
803
|
+
before?: string;
|
|
804
|
+
}): Promise<EditsResponse>;
|
|
805
|
+
/** Get a presigned URL for uploading a file. Returns the upload URL and file ID. */
|
|
806
|
+
getFileUploadUrl(params: {
|
|
807
|
+
file_name: string;
|
|
808
|
+
content_type?: string;
|
|
809
|
+
}): Promise<FileUploadUrlResponse>;
|
|
810
|
+
/** Set a project's visibility (draft, private, or public). */
|
|
811
|
+
setProjectVisibility(projectId: string, visibility: string): Promise<{
|
|
812
|
+
visibility: string;
|
|
813
|
+
}>;
|
|
814
|
+
/** Set a folder's visibility (personal or workspace). */
|
|
815
|
+
setFolderVisibility(workspaceId: string, folderId: string, visibility: string): Promise<{
|
|
816
|
+
visibility: string;
|
|
817
|
+
}>;
|
|
818
|
+
/** List available design system library projects in a workspace. */
|
|
819
|
+
listLibraryProjects(workspaceId: string): Promise<{
|
|
820
|
+
libraries: LibraryProjectResponse[];
|
|
821
|
+
}>;
|
|
822
|
+
/** List available template projects in a workspace. */
|
|
823
|
+
listTemplateProjects(workspaceId: string): Promise<{
|
|
824
|
+
templates: TemplateProjectResponse[];
|
|
825
|
+
}>;
|
|
826
|
+
/** List all MCP servers connected to a workspace. */
|
|
827
|
+
listMCPServers(workspaceId: string): Promise<{
|
|
828
|
+
servers: MCPServerResponse[];
|
|
829
|
+
}>;
|
|
830
|
+
/** Add an MCP server to a workspace. The server URL is tested before saving. */
|
|
831
|
+
addMCPServer(workspaceId: string, body: AddMCPServerBody): Promise<MCPServerResponse>;
|
|
832
|
+
/** Remove an MCP server from a workspace. */
|
|
833
|
+
removeMCPServer(workspaceId: string, serverId: string): Promise<{
|
|
834
|
+
success: boolean;
|
|
835
|
+
}>;
|
|
836
|
+
/** Browse available MCP server templates (catalog). */
|
|
837
|
+
listMCPCatalog(workspaceId: string): Promise<{
|
|
838
|
+
catalog: MCPCatalogEntry[];
|
|
839
|
+
}>;
|
|
840
|
+
/** List standard (OAuth-based) connectors in a workspace. */
|
|
841
|
+
listStandardConnectors(workspaceId: string): Promise<{
|
|
842
|
+
connectors: StandardConnectorItem[];
|
|
843
|
+
}>;
|
|
844
|
+
/** List seamless (zero-config) connectors in a workspace. */
|
|
845
|
+
listSeamlessConnectors(workspaceId: string): Promise<{
|
|
846
|
+
connectors: SeamlessConnectorItem[];
|
|
847
|
+
}>;
|
|
848
|
+
/** List MCP connectors in a workspace. */
|
|
849
|
+
listMCPConnectors(workspaceId: string): Promise<{
|
|
850
|
+
connectors: MCPConnectorItem[];
|
|
851
|
+
custom_enabled: boolean;
|
|
852
|
+
}>;
|
|
853
|
+
/** List authenticated connections (accounts) in a workspace. */
|
|
854
|
+
listConnections(workspaceId: string, params?: {
|
|
855
|
+
connector_id?: string;
|
|
856
|
+
}): Promise<{
|
|
857
|
+
connections: ConnectionItem[];
|
|
858
|
+
}>;
|
|
859
|
+
/** Get historical analytics for a published project. */
|
|
860
|
+
getProjectAnalytics(projectId: string, params: {
|
|
861
|
+
startDate: string;
|
|
862
|
+
endDate: string;
|
|
863
|
+
granularity?: string;
|
|
864
|
+
}): Promise<ProjectAnalyticsResponse>;
|
|
865
|
+
/** Get real-time visitor trend for a published project. */
|
|
866
|
+
getProjectAnalyticsTrend(projectId: string): Promise<ProjectAnalyticsTrendResponse>;
|
|
491
867
|
/**
|
|
492
868
|
* Publish a project.
|
|
493
869
|
*
|
|
@@ -623,4 +999,4 @@ declare class LovableClient {
|
|
|
623
999
|
waitForProjectPublished(projectId: string, options?: WaitOptions): Promise<ProjectResponse>;
|
|
624
1000
|
}
|
|
625
1001
|
|
|
626
|
-
export { type AddUserToWorkspaceInputBody, type BatchItemOutcome, type BatchReplayReviewsOutcome, type BatchTracesResult, type ChatMessageOptions, type ChatRequest, type ChatResponse, type ChatResponseOptions, type ContinuationOverride, type CreateProjectBody, type CreateProjectOptions, type CustomModelConfig, type DatabaseConnectionInfo, type DatabaseQueryResult, type DatabaseStatus, type DeploymentResponse, type EnableDatabaseResult, type FileInput, type GetMessageTracesOptions, type InviteCollaboratorOptions, LovableClient, type LovableClientOptions, type LovableError, type MeResponse, type MeWorkspace, type MemberRole, type MessageTracesResponse, type ProjectResponse, type ProjectStatus, type ProjectVisibility, type RemixJobStatus, type RemixJobStep, type RemixJobStepInfo, type RemixMode, type RemixProjectOptions, type RemixResult, type RemixWaitOptions, type ReplayOutcome, type ReplayReviewsItemInput, type ReplayReviewsRequestBody, type ReplayReviewsResponse, type ReviewerRunResult, type TracePurpose, type TraceQuery, type TraceSpan, type UnscopedFile, type WaitOptions, type WorkspaceMembership, type WorkspaceMembershipResponse, type WorkspaceWithMembership };
|
|
1002
|
+
export { type AddMCPServerBody, type AddUserToWorkspaceInputBody, ApiError, type BatchItemOutcome, type BatchReplayReviewsOutcome, type BatchTracesResult, type ChatMessageOptions, type ChatRequest, type ChatResponse, type ChatResponseOptions, type ConnectionItem, type ContinuationOverride, type CreateProjectBody, type CreateProjectOptions, type CustomModelConfig, type DatabaseConnectionInfo, type DatabaseQueryResult, type DatabaseStatus, type DeploymentResponse, type DiffEntry, type DiffHunk, type DiffLine, type EditSummary, type EditsResponse, type EnableDatabaseResult, type FileInput, type FileUploadUrlResponse, type GetMessageResponse, type GetMessageTracesOptions, type GitDiffResponse, type GitFileEntry, type GitFilesResponse, type InviteCollaboratorOptions, type KnowledgeResponse, type LibraryProjectResponse, type ListData, type ListDataPoint, type ListProjectItem, type ListProjectsOptions, type ListProjectsResponse, LovableClient, type LovableClientOptions, type LovableError, type MCPCatalogEntry, type MCPConnectorItem, type MCPServerResponse, type MeResponse, type MeWorkspace, type MemberRole, type MessageCompletionOptions, type MessageCompletionResult, type MessageTracesResponse, type ProjectAnalyticsResponse, type ProjectAnalyticsTrendResponse, type ProjectResponse, type ProjectStatus, type ProjectVisibility, type RemixJobStatus, type RemixJobStep, type RemixJobStepInfo, type RemixMode, type RemixProjectOptions, type RemixResult, type RemixWaitOptions, type ReplayOutcome, type ReplayReviewsItemInput, type ReplayReviewsRequestBody, type ReplayReviewsResponse, type ReviewerRunResult, type SeamlessConnectorItem, type SendMessageResponse, type StandardConnectorItem, type TemplateProjectResponse, type TimeSeriesData, type TimeSeriesDataPoint, type TracePurpose, type TraceQuery, type TraceSpan, type TrendDataPoint, type UnscopedFile, type WaitOptions, type WorkspaceMembership, type WorkspaceMembershipResponse, type WorkspaceWithMembership };
|