@builder.io/ai-utils 0.58.1 → 0.59.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/package.json +1 -1
- package/src/claw.d.ts +6 -0
- package/src/claw.js +9 -0
- package/src/claw.spec.js +27 -0
- package/src/codegen.d.ts +44 -1
- package/src/codegen.js +2 -0
- package/src/design-systems.d.ts +38 -0
- package/src/design-systems.js +14 -0
- package/src/events.d.ts +2 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/projects.d.ts +118 -3
- package/src/projects.js +1 -0
package/package.json
CHANGED
package/src/claw.d.ts
CHANGED
|
@@ -78,6 +78,8 @@ export interface WorkerReportOptions {
|
|
|
78
78
|
originChannelId?: string;
|
|
79
79
|
/** Clickable URL for the origin channel, if the integration already has one. */
|
|
80
80
|
channelUrl?: string;
|
|
81
|
+
/** Human-readable name for the origin channel, if the integration has one. */
|
|
82
|
+
channelName?: string;
|
|
81
83
|
/** The report content. */
|
|
82
84
|
content: string;
|
|
83
85
|
/** Agent/tool ID (for sub-agent reports). */
|
|
@@ -88,6 +90,8 @@ export interface WorkerMessageOptions {
|
|
|
88
90
|
originChannelId?: string;
|
|
89
91
|
/** Clickable URL for the origin channel, if the integration already has one. */
|
|
90
92
|
channelUrl?: string;
|
|
93
|
+
/** Human-readable name for the origin channel, if the integration has one. */
|
|
94
|
+
channelName?: string;
|
|
91
95
|
/** The report content. */
|
|
92
96
|
content: string;
|
|
93
97
|
/** Project ID (for branch reports). */
|
|
@@ -128,6 +132,8 @@ export interface IncomingMessageOptions {
|
|
|
128
132
|
channelId: string;
|
|
129
133
|
/** Clickable URL for channelId, if the integration already has one. */
|
|
130
134
|
channelUrl?: string;
|
|
135
|
+
/** Human-readable channel name, if the integration has one. */
|
|
136
|
+
channelName?: string;
|
|
131
137
|
/** DM channel ID, if the message was a direct message. */
|
|
132
138
|
dmId?: string;
|
|
133
139
|
/** Display name of the sender. */
|
package/src/claw.js
CHANGED
|
@@ -101,6 +101,9 @@ export function formatWorkerReport(opts) {
|
|
|
101
101
|
if (url) {
|
|
102
102
|
xml += `<origin_channel_url>${url}</origin_channel_url>\n`;
|
|
103
103
|
}
|
|
104
|
+
if (opts.channelName) {
|
|
105
|
+
xml += `<origin_channel_name>${opts.channelName}</origin_channel_name>\n`;
|
|
106
|
+
}
|
|
104
107
|
}
|
|
105
108
|
xml += `<agent_id>${opts.agentId}</agent_id>\n`;
|
|
106
109
|
xml += `<content>\n${opts.content.trim()}\n</content>\n`;
|
|
@@ -117,6 +120,9 @@ export function formatWorkerMessage(opts) {
|
|
|
117
120
|
if (url) {
|
|
118
121
|
xml += `<origin_channel_url>${url}</origin_channel_url>\n`;
|
|
119
122
|
}
|
|
123
|
+
if (opts.channelName) {
|
|
124
|
+
xml += `<origin_channel_name>${opts.channelName}</origin_channel_name>\n`;
|
|
125
|
+
}
|
|
120
126
|
}
|
|
121
127
|
if (opts.senderDisplayName) {
|
|
122
128
|
xml += `<sender>${opts.senderDisplayName}</sender>\n`;
|
|
@@ -166,6 +172,9 @@ export function formatIncomingMessage(opts) {
|
|
|
166
172
|
if (channelUrl) {
|
|
167
173
|
result += `<channel_url>${channelUrl}</channel_url>\n`;
|
|
168
174
|
}
|
|
175
|
+
if (opts.channelName) {
|
|
176
|
+
result += `<channel_name>${opts.channelName}</channel_name>\n`;
|
|
177
|
+
}
|
|
169
178
|
if (opts.dmId) {
|
|
170
179
|
result += `<dm_id>${opts.dmId}</dm_id>\n`;
|
|
171
180
|
}
|
package/src/claw.spec.js
CHANGED
|
@@ -103,6 +103,16 @@ describe("formatIncomingMessage", () => {
|
|
|
103
103
|
});
|
|
104
104
|
expect(result).toContain("<channel_url>https://test.atlassian.net/browse/PROJ-123</channel_url>");
|
|
105
105
|
});
|
|
106
|
+
it("includes channel_name when provided by the integration", () => {
|
|
107
|
+
const result = formatIncomingMessage({
|
|
108
|
+
channelId: "slack/thread/TTEAM/CCHAN/1234567890.000100",
|
|
109
|
+
channelName: "#engineering",
|
|
110
|
+
sender: "Charlie",
|
|
111
|
+
timestamp: "Wednesday, January 3, 2024 at 12:00 PM PST",
|
|
112
|
+
content: "Slack message",
|
|
113
|
+
});
|
|
114
|
+
expect(result).toContain("<channel_name>#engineering</channel_name>");
|
|
115
|
+
});
|
|
106
116
|
it("does not include channel_url for unsupported platforms", () => {
|
|
107
117
|
const result = formatIncomingMessage({
|
|
108
118
|
channelId: "telegram/chat/123456",
|
|
@@ -154,6 +164,14 @@ describe("formatWorkerMessage", () => {
|
|
|
154
164
|
});
|
|
155
165
|
expect(result).toContain("<origin_channel_url>https://test.atlassian.net/browse/PROJ-456</origin_channel_url>");
|
|
156
166
|
});
|
|
167
|
+
it("includes origin_channel_name when provided by the integration", () => {
|
|
168
|
+
const result = formatWorkerMessage({
|
|
169
|
+
originChannelId: "slack/thread/TTEAM/CCHAN/1234567890.000100",
|
|
170
|
+
channelName: "#engineering",
|
|
171
|
+
content: "Worker result",
|
|
172
|
+
});
|
|
173
|
+
expect(result).toContain("<origin_channel_name>#engineering</origin_channel_name>");
|
|
174
|
+
});
|
|
157
175
|
it("does not include origin_channel_url for unsupported platforms", () => {
|
|
158
176
|
const result = formatWorkerMessage({
|
|
159
177
|
originChannelId: "builder/branch/proj-id/my-branch",
|
|
@@ -195,6 +213,15 @@ describe("formatWorkerReport", () => {
|
|
|
195
213
|
});
|
|
196
214
|
expect(result).toContain("<origin_channel_url>https://test.atlassian.net/browse/PROJ-789</origin_channel_url>");
|
|
197
215
|
});
|
|
216
|
+
it("includes origin_channel_name when provided by the integration", () => {
|
|
217
|
+
const result = formatWorkerReport({
|
|
218
|
+
originChannelId: "slack/channel/TTEAM/CCHAN",
|
|
219
|
+
channelName: "#engineering",
|
|
220
|
+
content: "Report content",
|
|
221
|
+
agentId: "agent-xyz",
|
|
222
|
+
});
|
|
223
|
+
expect(result).toContain("<origin_channel_name>#engineering</origin_channel_name>");
|
|
224
|
+
});
|
|
198
225
|
it("does not include origin_channel_url for unsupported platforms", () => {
|
|
199
226
|
const result = formatWorkerReport({
|
|
200
227
|
originChannelId: "telegram/chat/123456",
|
package/src/codegen.d.ts
CHANGED
|
@@ -110,6 +110,15 @@ export interface CustomAgentDefinition {
|
|
|
110
110
|
maxCompletions?: number;
|
|
111
111
|
/** Default reasoning effort level for this agent type. Overrides the session default. */
|
|
112
112
|
reasoning?: ReasoningEffort;
|
|
113
|
+
/**
|
|
114
|
+
* Default {@link SyncChangesFromRemote} policy applied to messages received
|
|
115
|
+
* by this agent when the message itself does not specify `syncChanges`.
|
|
116
|
+
* Only consulted at the session/sub-agent level (i.e. when the session was
|
|
117
|
+
* spawned with `agentType` equal to this agent's name). Use cases include
|
|
118
|
+
* always resetting the working branch to its base before each new message
|
|
119
|
+
* (e.g. the setup-project agent).
|
|
120
|
+
*/
|
|
121
|
+
defaultSyncChanges?: SyncChangesFromRemote;
|
|
113
122
|
/**
|
|
114
123
|
* Where this agent was discovered. Drives precedence on name collision:
|
|
115
124
|
* `project` > `user` > `plugin`. Set by the discovery loader, not by the
|
|
@@ -540,6 +549,9 @@ export interface ExitToolInput {
|
|
|
540
549
|
devServerNeedsCredentials?: boolean;
|
|
541
550
|
needsVPN?: boolean;
|
|
542
551
|
autoReload?: boolean;
|
|
552
|
+
usesBuilderCms?: boolean;
|
|
553
|
+
/** Technologies used by the connected application (e.g. ["React", "Next.js", "Postgres", "Drizzle"]) */
|
|
554
|
+
stack?: string[];
|
|
543
555
|
/** A human-readable description of what the project is about (not tech specs), used by fusion to route requests to the right project */
|
|
544
556
|
projectDescription?: string;
|
|
545
557
|
}
|
|
@@ -638,6 +650,8 @@ export interface ProposedConfig {
|
|
|
638
650
|
durationMs?: number;
|
|
639
651
|
needsVPN?: boolean;
|
|
640
652
|
autoReload?: boolean;
|
|
653
|
+
usesBuilderCms?: boolean;
|
|
654
|
+
stack?: string[];
|
|
641
655
|
}
|
|
642
656
|
/**
|
|
643
657
|
* Parameters for proposing a configuration to the backend
|
|
@@ -671,6 +685,8 @@ export interface ProposeConfigParams {
|
|
|
671
685
|
needsVPN?: boolean;
|
|
672
686
|
projectDescription?: string;
|
|
673
687
|
autoReload?: boolean;
|
|
688
|
+
usesBuilderCms?: boolean;
|
|
689
|
+
stack?: string[];
|
|
674
690
|
}
|
|
675
691
|
export interface VerifySetupCommandToolInput {
|
|
676
692
|
command: string;
|
|
@@ -705,6 +721,26 @@ export interface SetEnvVariableToolInput {
|
|
|
705
721
|
placeholder?: boolean;
|
|
706
722
|
explanation?: string;
|
|
707
723
|
}
|
|
724
|
+
export interface SetFileOverrideToolInput {
|
|
725
|
+
/**
|
|
726
|
+
* Path where the file should be written. Supports absolute paths
|
|
727
|
+
* ("/app/.npmrc"), tilde ("~/.npmrc") and paths relative to the project
|
|
728
|
+
* working directory ("./.npmrc"). Use this tool ONLY for configuration-only
|
|
729
|
+
* files that should NOT be committed to the repo (e.g. `.npmrc` with auth
|
|
730
|
+
* tokens, machine-local env files) — never to patch source code or fix
|
|
731
|
+
* software issues.
|
|
732
|
+
*/
|
|
733
|
+
path: string;
|
|
734
|
+
/**
|
|
735
|
+
* Plain text content to write to the file. Mutually exclusive with `base64`.
|
|
736
|
+
*/
|
|
737
|
+
content?: string;
|
|
738
|
+
/**
|
|
739
|
+
* Base64-encoded binary content to write to the file. Mutually exclusive
|
|
740
|
+
* with `content`. Use only when the file is genuinely binary.
|
|
741
|
+
*/
|
|
742
|
+
base64?: string;
|
|
743
|
+
}
|
|
708
744
|
export interface SendMessageToolInput {
|
|
709
745
|
channel_id: string;
|
|
710
746
|
markdown: string;
|
|
@@ -858,6 +894,7 @@ export interface CodeGenToolMap {
|
|
|
858
894
|
VerifyValidateCommand: VerifyValidateCommandToolInput;
|
|
859
895
|
ProposeEnvVariable: ProposeEnvVariableToolInput;
|
|
860
896
|
SetEnvVariable: SetEnvVariableToolInput;
|
|
897
|
+
SetFileOverride: SetFileOverrideToolInput;
|
|
861
898
|
SendMessage: SendMessageToolInput;
|
|
862
899
|
SpawnBranch: SpawnBranchToolInput;
|
|
863
900
|
CreateProject: CreateProjectToolInput;
|
|
@@ -874,6 +911,10 @@ export interface CodeGenToolMap {
|
|
|
874
911
|
export interface EnsurePRToolInput {
|
|
875
912
|
project_id: string;
|
|
876
913
|
branch_name: string;
|
|
914
|
+
/** Builder.io user ID to attribute the PR to. Must be a member of the org. */
|
|
915
|
+
builder_user_id?: string;
|
|
916
|
+
/** Whether to create the PR as a draft. Defaults to false. */
|
|
917
|
+
draft?: boolean;
|
|
877
918
|
}
|
|
878
919
|
export interface EscalateToPlanner {
|
|
879
920
|
/** What's blocking execution */
|
|
@@ -961,7 +1002,7 @@ export declare const DEFAULT_QUEUE_BEHAVIOR: QueueBehavior;
|
|
|
961
1002
|
/** True for any schedule that aborts the in-flight run on enqueue. */
|
|
962
1003
|
export declare function isInterruptSchedule(schedule: QueueSchedule): boolean;
|
|
963
1004
|
export declare function normalizeQueueMode(mode: QueueMode | undefined): QueueBehavior;
|
|
964
|
-
export declare const BASE_CODEGEN_POSITIONS: readonly ["fusion", "editor-ai", "repo-indexing", "cli", "create-app-firebase", "create-app-lovable", "builder-code-panel", "setup-project", "code-review-orchestrator", "project-configuration", "org-agent", "org-worker", "browser-testing", "projects-scheduler-memory-extraction", "builder-code", "unknown", "dsi-mcp"];
|
|
1005
|
+
export declare const BASE_CODEGEN_POSITIONS: readonly ["fusion", "editor-ai", "repo-indexing", "cli", "create-app-firebase", "create-app-lovable", "builder-code-panel", "setup-project", "code-review-orchestrator", "project-configuration", "org-agent", "org-worker", "browser-testing", "projects-scheduler-memory-extraction", "builder-code", "unknown", "dsi-mcp", "design-system-indexer", "builder-publish-integration"];
|
|
965
1006
|
export type BaseCodeGenPosition = (typeof BASE_CODEGEN_POSITIONS)[number];
|
|
966
1007
|
export type CodeGenPosition = BaseCodeGenPosition | `${BaseCodeGenPosition}-agent`;
|
|
967
1008
|
export interface RepoIndexingConfig {
|
|
@@ -1255,6 +1296,7 @@ export interface GenerateCompletionStepDone {
|
|
|
1255
1296
|
usage: CodegenUsage | undefined;
|
|
1256
1297
|
url?: string;
|
|
1257
1298
|
promptVersion: string | undefined;
|
|
1299
|
+
planPath: string | undefined;
|
|
1258
1300
|
stopReason: CompletionStopReason;
|
|
1259
1301
|
hasChanges: boolean;
|
|
1260
1302
|
}
|
|
@@ -1709,6 +1751,7 @@ export interface GenerateCodeEventDone {
|
|
|
1709
1751
|
actionTitle: string;
|
|
1710
1752
|
content?: string;
|
|
1711
1753
|
needsPagination: boolean;
|
|
1754
|
+
planPath: string | undefined;
|
|
1712
1755
|
actions?: ActionItem[];
|
|
1713
1756
|
suggestions: PromptSuggestion[];
|
|
1714
1757
|
creditsUsed: number;
|
package/src/codegen.js
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export type GenerateDesignSystemAttachmentKind = "fig" | "image" | "pdf" | "text";
|
|
3
|
+
export interface GenerateDesignSystemFormFields {
|
|
4
|
+
/**
|
|
5
|
+
* Human-friendly project name. If omitted, the server generates one from
|
|
6
|
+
* the uploaded `.fig` filenames.
|
|
7
|
+
*/
|
|
8
|
+
projectName?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface GenerateDesignSystemRequest extends GenerateDesignSystemFormFields {
|
|
11
|
+
/**
|
|
12
|
+
* Mixed list of uploaded files in any order. Sent as repeated
|
|
13
|
+
* `attachments` fields in the multipart body.
|
|
14
|
+
*/
|
|
15
|
+
attachments: File[];
|
|
16
|
+
}
|
|
17
|
+
export interface GenerateDesignSystemResponse {
|
|
18
|
+
projectId: string;
|
|
19
|
+
branchName: string;
|
|
20
|
+
branchUrl: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GenerateDesignSystemErrorResponse {
|
|
23
|
+
error: string | Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export declare const GENERATE_DESIGN_SYSTEM_MAX_FILE_BYTES: number;
|
|
26
|
+
export declare const GENERATE_DESIGN_SYSTEM_MAX_ATTACHMENTS = 50;
|
|
27
|
+
export declare const GENERATE_DESIGN_SYSTEM_MIN_ATTACHMENTS = 1;
|
|
28
|
+
/**
|
|
29
|
+
* Validation for non-file fields posted alongside the multipart upload.
|
|
30
|
+
* Files are parsed out of the body by multer before this schema runs.
|
|
31
|
+
*
|
|
32
|
+
* The inferred type matches `GenerateDesignSystemFormFields` so the wire
|
|
33
|
+
* contract stays in lockstep with the shared type.
|
|
34
|
+
*/
|
|
35
|
+
export declare const generateDesignSystemBodySchema: z.ZodObject<{
|
|
36
|
+
projectName: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type GenerateDesignSystemBody = z.infer<typeof generateDesignSystemBodySchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const GENERATE_DESIGN_SYSTEM_MAX_FILE_BYTES = 100 * 1024 * 1024;
|
|
3
|
+
export const GENERATE_DESIGN_SYSTEM_MAX_ATTACHMENTS = 50;
|
|
4
|
+
export const GENERATE_DESIGN_SYSTEM_MIN_ATTACHMENTS = 1;
|
|
5
|
+
/**
|
|
6
|
+
* Validation for non-file fields posted alongside the multipart upload.
|
|
7
|
+
* Files are parsed out of the body by multer before this schema runs.
|
|
8
|
+
*
|
|
9
|
+
* The inferred type matches `GenerateDesignSystemFormFields` so the wire
|
|
10
|
+
* contract stays in lockstep with the shared type.
|
|
11
|
+
*/
|
|
12
|
+
export const generateDesignSystemBodySchema = z.object({
|
|
13
|
+
projectName: z.string().trim().min(1).max(200).optional(),
|
|
14
|
+
});
|
package/src/events.d.ts
CHANGED
|
@@ -625,6 +625,7 @@ export type ClawMessageSentV1 = FusionEventVariant<"claw.message.sent", {
|
|
|
625
625
|
channelId?: string;
|
|
626
626
|
/** Optional clickable URL for channelId. */
|
|
627
627
|
channelUrl?: string;
|
|
628
|
+
channelName?: string;
|
|
628
629
|
dmId?: string;
|
|
629
630
|
senderDisplayName?: string;
|
|
630
631
|
agentBranchName?: string;
|
|
@@ -785,6 +786,7 @@ export interface SendMessageToOrgAgentInput {
|
|
|
785
786
|
channelId?: string;
|
|
786
787
|
/** Optional clickable URL for channelId. */
|
|
787
788
|
channelUrl?: string;
|
|
789
|
+
channelName?: string;
|
|
788
790
|
senderDisplayName?: string;
|
|
789
791
|
messageContext?: string;
|
|
790
792
|
senderId?: string;
|
package/src/index.d.ts
CHANGED
|
@@ -14,4 +14,5 @@ export * from "./claw.js";
|
|
|
14
14
|
export * from "./kube-error.js";
|
|
15
15
|
export * from "./connectivity/types.js";
|
|
16
16
|
export * from "./single-tenancy.js";
|
|
17
|
+
export * from "./design-systems.js";
|
|
17
18
|
export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
|
package/src/index.js
CHANGED
|
@@ -14,4 +14,5 @@ export * from "./claw.js";
|
|
|
14
14
|
export * from "./kube-error.js";
|
|
15
15
|
export * from "./connectivity/types.js";
|
|
16
16
|
export * from "./single-tenancy.js";
|
|
17
|
+
export * from "./design-systems.js";
|
|
17
18
|
export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
|
package/src/projects.d.ts
CHANGED
|
@@ -224,6 +224,7 @@ export interface GitConfig {
|
|
|
224
224
|
export type GitConfigs = Record<string, GitConfig>;
|
|
225
225
|
export declare const EXAMPLE_REPOS: string[];
|
|
226
226
|
export declare const STARTER_REPO = "BuilderIO/fusion-starter";
|
|
227
|
+
export declare const DSI_PREVIEW_REPO = "BuilderIO/dsi-starter";
|
|
227
228
|
export declare const EXAMPLE_OR_STARTER_REPOS: string[];
|
|
228
229
|
export declare const EXAMPLE_OR_STARTER_REPOS_URLS: string[];
|
|
229
230
|
export interface GitBackupUploadUrlResult {
|
|
@@ -340,7 +341,7 @@ export interface SetupScriptDependency {
|
|
|
340
341
|
script: string;
|
|
341
342
|
}
|
|
342
343
|
export type FusionExecutionEnvironment = "containerized" | "container-less" | "cloud" | "cloud-v2";
|
|
343
|
-
export type AgentType = "setup-project" | "project-configuration" | "org-agent" | "code-review-orchestrator";
|
|
344
|
+
export type AgentType = "setup-project" | "project-configuration" | "org-agent" | "code-review-orchestrator" | "design-system-indexer" | "builder-publish-integration";
|
|
344
345
|
export interface PartialBranchData {
|
|
345
346
|
name?: string;
|
|
346
347
|
createdBy: string;
|
|
@@ -445,7 +446,7 @@ export interface OrgAgentConfig {
|
|
|
445
446
|
enabledTools: string[];
|
|
446
447
|
longLived: boolean;
|
|
447
448
|
}
|
|
448
|
-
export type BranchType = "code-review" | "setup-project" | "org-agent" | "default";
|
|
449
|
+
export type BranchType = "code-review" | "setup-project" | "org-agent" | "design-system-indexing" | "default";
|
|
449
450
|
/** Category of work a branch represents, auto-assigned during prompt analysis. */
|
|
450
451
|
export type BranchCategory = "feature" | "fix" | "research" | "other";
|
|
451
452
|
export interface BranchSharedData {
|
|
@@ -598,15 +599,25 @@ export interface PreviewPasswordProtection {
|
|
|
598
599
|
password?: string;
|
|
599
600
|
}
|
|
600
601
|
export interface Project {
|
|
602
|
+
/** Unique project identifier. */
|
|
601
603
|
id: string;
|
|
604
|
+
/** Display name of the project. */
|
|
602
605
|
name: string;
|
|
606
|
+
/** ID of the space (organization) that owns this project. */
|
|
603
607
|
ownerId: string;
|
|
608
|
+
/** Full repo name in the form "owner/repo", e.g. "acme/frontend". */
|
|
604
609
|
repoFullName: string | undefined;
|
|
610
|
+
/** Git hosting provider: "github", "gitlab", "azure", "bitbucket", etc. */
|
|
605
611
|
repoProvider: string;
|
|
612
|
+
/** Clone protocol: "https" or "ssh". */
|
|
606
613
|
repoProtocol: string | undefined;
|
|
614
|
+
/** Optional human-readable description of the project. */
|
|
607
615
|
description?: string;
|
|
616
|
+
/** Description pulled from the connected git repository's metadata. */
|
|
608
617
|
repoDescription?: string;
|
|
618
|
+
/** Whether the connected repository is private. */
|
|
609
619
|
repoPrivate: boolean;
|
|
620
|
+
/** Full clone URL of the repository. */
|
|
610
621
|
repoUrl: string | undefined;
|
|
611
622
|
/** 8-character SHA-256 hash of normalized repoUrl for cross-project matching */
|
|
612
623
|
repoHash?: string;
|
|
@@ -614,103 +625,195 @@ export interface Project {
|
|
|
614
625
|
createdDate: InMigrationDate;
|
|
615
626
|
/** MIGRATION: accepts both string and number during migration period */
|
|
616
627
|
updatedAt: InMigrationDate;
|
|
628
|
+
/** When true, the project appears at the top of the project list. */
|
|
617
629
|
pinned?: boolean;
|
|
630
|
+
/** Sort order among pinned projects. */
|
|
618
631
|
pinOrder?: number;
|
|
632
|
+
/** When true, the project is archived and hidden from the default view. */
|
|
619
633
|
archived?: boolean;
|
|
634
|
+
/** User ID of the person who created the project. */
|
|
620
635
|
createdBy: string;
|
|
636
|
+
/** User ID of the last person to update the project. */
|
|
621
637
|
lastUpdateBy?: string;
|
|
638
|
+
/** Internal counter tracking CI check run outcomes per status. */
|
|
622
639
|
checkRunCounts?: Record<string, number>;
|
|
640
|
+
/** User ID of whoever added the repository connection. */
|
|
623
641
|
repoAddedBy?: string;
|
|
642
|
+
/** Internal counter tracking pipeline run outcomes per status. */
|
|
624
643
|
pipelineCounts?: Record<string, number>;
|
|
644
|
+
/** When true, the project has not completed initial setup. */
|
|
625
645
|
needSetup?: boolean;
|
|
646
|
+
/** Project purpose: general app or design-system indexing target. */
|
|
626
647
|
projectType?: "app" | "repo-indexing";
|
|
648
|
+
/** Custom domains associated with this project. */
|
|
627
649
|
domains?: string[];
|
|
650
|
+
/** Whether the project is publicly accessible. */
|
|
628
651
|
accessMode?: "public" | "private";
|
|
652
|
+
/** Fine-grained access control configuration for the project. */
|
|
629
653
|
projectAccess?: ProjectAccessControl;
|
|
630
654
|
settings: {
|
|
655
|
+
/** When true, this is a native (mobile/desktop) app with no web dev server. */
|
|
631
656
|
isNativeApp?: boolean;
|
|
657
|
+
/** When true, automatically detect the dev server URL from command output (Desktop app only). */
|
|
632
658
|
autoDetectDevServer?: boolean;
|
|
659
|
+
/** Regex patterns matched against dev command output to detect the server URL. */
|
|
633
660
|
autoDetectDevServerPatterns?: string[];
|
|
661
|
+
/** Execution environment for the Fusion runtime (cloud, containerized, container-less). */
|
|
634
662
|
fusionEnvironment?: FusionExecutionEnvironment;
|
|
663
|
+
/** Port the dev server listens on inside the container. Use 0 for auto-assign. Default: 3000. */
|
|
635
664
|
devServerPort?: number;
|
|
665
|
+
/** @internal Explicit dev server URL; overrides auto-detection. Set by the system, not user-configurable. */
|
|
636
666
|
devServerUrl?: string;
|
|
667
|
+
/** @internal Whether to reload the preview when files change. Managed by the app UI. */
|
|
637
668
|
refreshPreview?: boolean;
|
|
669
|
+
/** Commands to install dependencies before starting the dev server (e.g. "npm install"). */
|
|
638
670
|
installCommand?: string;
|
|
671
|
+
/** @internal Command to run validation checks. Used internally by the setup agent. */
|
|
639
672
|
validateCommand?: string;
|
|
673
|
+
/** @internal URL origin used for the dev server proxy. Related to Electron proxy configuration. Exposed via specific UI; not a free-text field. */
|
|
640
674
|
proxyOrigin?: string;
|
|
675
|
+
/** @internal Default proxy origin, resolved at runtime. */
|
|
641
676
|
proxyDefaultOrigin?: string;
|
|
677
|
+
/** @internal Mode for automatically pushing AI commits. Managed by the app. */
|
|
642
678
|
defaultAutoPush?: AutoPushMode;
|
|
679
|
+
/** How branch names are generated: ai-session ID, descriptive name, or a custom pattern. */
|
|
643
680
|
gitBranchNamingStrategy?: "ai-session" | "branch-name" | "custom";
|
|
681
|
+
/** @internal Mise tools and custom scripts run before the setup command. Managed via builder.config.json. */
|
|
644
682
|
setupDependencies?: SetupDependency[];
|
|
683
|
+
/** Custom branch name pattern used when gitBranchNamingStrategy is "custom". */
|
|
645
684
|
gitBranchNamingCustom?: string;
|
|
685
|
+
/** When true, the user is prompted to provide a branch name before a new branch is created. */
|
|
646
686
|
askUserForBranchName?: boolean;
|
|
687
|
+
/** Command to start the dev server (e.g. "npm run dev"). */
|
|
647
688
|
devServerCommand?: string;
|
|
689
|
+
/** CPU tier for the container: "performance", "standard", or "shared". */
|
|
648
690
|
cpuKind?: CpuKind;
|
|
691
|
+
/** Number of vCPUs allocated to the container: 1, 2, or 4. */
|
|
649
692
|
cpus?: 1 | 2 | 4;
|
|
693
|
+
/** RAM allocated to the container in MB. Higher values (8192/16384) are enterprise-only. Default: 4096. */
|
|
650
694
|
memory?: 2048 | 4096 | 8192 | 16384;
|
|
651
|
-
/** @deprecated */
|
|
695
|
+
/** @deprecated Use {@link memory} instead. */
|
|
652
696
|
memoryLimit?: 1024 | 2048 | 4096 | 8192 | 16384;
|
|
697
|
+
/** Idle behavior for the container: stop, suspend, or stay on. Default: "suspend". */
|
|
653
698
|
autoStop?: MachineAutoStop;
|
|
699
|
+
/** Base branch used when cloning and creating new branches. Default: "main". */
|
|
654
700
|
mainBranchName?: string;
|
|
701
|
+
/** Minimum number of machines kept alive at all times. Default: 0. */
|
|
655
702
|
minMachinesRunning?: number;
|
|
703
|
+
/** Persistent disk size in GB. Default: 5. */
|
|
656
704
|
volumeSize?: 5 | 10 | 12 | 15 | 20 | 25 | 30 | 50;
|
|
705
|
+
/** @internal Subpath within the repository to use as the working root. */
|
|
657
706
|
includePath?: string;
|
|
707
|
+
/** Glob patterns limiting which paths are included when cloning or processing. */
|
|
658
708
|
includePatterns?: string[];
|
|
709
|
+
/** Environment variables injected into the dev container. */
|
|
659
710
|
environmentVariables?: EnvironmentVariable[];
|
|
711
|
+
/** Files injected into the container during setup, written before installCommand runs. */
|
|
660
712
|
fileOverrides?: FileOverride[];
|
|
713
|
+
/** Structured instruction rules applied to AI sessions (name, content, scope, tool allowlists). */
|
|
661
714
|
customInstructions?: CustomInstruction[];
|
|
715
|
+
/** Definitions for specialized sub-agents with custom system prompts, tools, and model overrides. */
|
|
662
716
|
customAgents?: CustomAgentDefinition[];
|
|
717
|
+
/** How the AI commits changes: direct commits, draft PRs, or ready-for-review PRs. Default: "draft-prs". */
|
|
663
718
|
commitMode?: CommitMode;
|
|
719
|
+
/** Default visibility for new branches: shared (team-visible) or private. Default: "private". */
|
|
664
720
|
defaultBranchType?: "shared" | "private";
|
|
721
|
+
/** Custom container image path (e.g. ghcr.io/org/image:tag). Overrides nodeVersion when set. */
|
|
665
722
|
dockerImagePath?: string;
|
|
723
|
+
/** Node.js version to use in the container (e.g. "22"). Ignored when dockerImagePath is set. */
|
|
666
724
|
nodeVersion?: string;
|
|
725
|
+
/** Named design systems to expose for AI assistance. */
|
|
667
726
|
designSystems?: string[];
|
|
727
|
+
/** @internal Use @antfu/ni for package management instead of direct npm/yarn/pnpm commands. */
|
|
668
728
|
useNI?: boolean;
|
|
729
|
+
/** Additional repositories cloned alongside the main repo for extra AI context. */
|
|
669
730
|
folders?: Array<{
|
|
731
|
+
/** Identifier for this workspace folder (kebab/snake case recommended). */
|
|
670
732
|
name: string;
|
|
733
|
+
/** Full clone URL of the repository (must end in .git for GitHub/GitLab). */
|
|
671
734
|
remoteUrl: string;
|
|
735
|
+
/** Base branch to clone. Default: "main". */
|
|
672
736
|
mainBranchName?: string;
|
|
737
|
+
/** Subpath within this repo to use as the working root. */
|
|
673
738
|
includePath?: string;
|
|
739
|
+
/** User ID of whoever added this folder. */
|
|
674
740
|
addedBy?: string;
|
|
741
|
+
/** Detected or specified git provider. */
|
|
675
742
|
repoProvider?: string;
|
|
743
|
+
/** Clone protocol: "https" or "ssh". */
|
|
676
744
|
repoProtocol?: string;
|
|
745
|
+
/** Whether to track git history for this folder. */
|
|
677
746
|
enableGit?: boolean;
|
|
678
747
|
}>;
|
|
748
|
+
/** Freeform workspace-level AI instructions, equivalent to an AGENTS.md file. */
|
|
679
749
|
agentsMD?: string;
|
|
750
|
+
/** One-time command run after the repo is first cloned, before installCommand. */
|
|
680
751
|
initializationCommand?: string;
|
|
752
|
+
/** @internal Subpath within the repo recommended by auto-detection as the project root. */
|
|
681
753
|
repoSubpath?: string;
|
|
754
|
+
/** @internal Workspace root recommended by auto-setup analysis; not user-configurable. */
|
|
682
755
|
recommendedRoot?: string;
|
|
756
|
+
/** Enable HTTPS for the dev server proxy. Default: false. */
|
|
683
757
|
https?: boolean;
|
|
758
|
+
/** Custom local domain for HTTPS (e.g. "myapp.local"). */
|
|
684
759
|
localHttpsDomain?: string;
|
|
760
|
+
/** Browser automation configuration for AI-driven end-to-end testing and visual verification. */
|
|
685
761
|
browserAutomation?: {
|
|
762
|
+
/** Run browser automation tasks as background agents. */
|
|
686
763
|
backgroundAgents?: boolean;
|
|
764
|
+
/** Custom instructions for the browser agent. */
|
|
687
765
|
instructions?: string;
|
|
766
|
+
/** Username for sites requiring authentication. */
|
|
688
767
|
authUser?: string;
|
|
768
|
+
/** Password for sites requiring authentication. */
|
|
689
769
|
authPassword?: string;
|
|
690
770
|
};
|
|
771
|
+
/** Automated PR reviewer configuration. */
|
|
691
772
|
prReviewer?: {
|
|
773
|
+
/** Whether the automated reviewer is enabled. */
|
|
692
774
|
enabled: boolean;
|
|
775
|
+
/** Custom review guidelines for the reviewer. */
|
|
693
776
|
instructions?: string;
|
|
777
|
+
/** How deeply to review: "low", "medium" (default), or "high". */
|
|
694
778
|
reviewEffort?: ReviewEffort;
|
|
695
779
|
};
|
|
780
|
+
/** Enable volume snapshots so session state can be saved and restored. */
|
|
696
781
|
enableSnapshots?: boolean;
|
|
782
|
+
/** When true, the AI captures memories after a branch is merged for use in future sessions. */
|
|
697
783
|
postMergeMemories?: boolean;
|
|
784
|
+
/** @internal Custom instructions for AI-generated commit messages. */
|
|
698
785
|
commitInstructions?: string;
|
|
786
|
+
/** Maximum number of AI completions allowed per agent session. */
|
|
699
787
|
maxAgentCompletions?: number;
|
|
788
|
+
/** @internal Bypass command security restrictions. Admin use only. */
|
|
700
789
|
skipCommandSecurity?: boolean;
|
|
790
|
+
/** File path to the HTTPS private key. */
|
|
701
791
|
httpsServerKeyPath?: string;
|
|
792
|
+
/** File path to the HTTPS certificate. */
|
|
702
793
|
httpsServerCertPath?: string;
|
|
794
|
+
/** File path to the HTTPS CA certificate. */
|
|
703
795
|
httpsServerCaPath?: string;
|
|
796
|
+
/** HTTPS private key content as a string (alternative to httpsServerKeyPath). */
|
|
704
797
|
httpsServerKeyContent?: string;
|
|
798
|
+
/** HTTPS certificate content as a string (alternative to httpsServerCertPath). */
|
|
705
799
|
httpsServerCertContent?: string;
|
|
800
|
+
/** HTTPS CA certificate content as a string (alternative to httpsServerCaPath). */
|
|
706
801
|
httpsServerCaContent?: string;
|
|
802
|
+
/** PFX/PKCS12 bundle for HTTPS. */
|
|
707
803
|
httpsServerPfx?: string;
|
|
804
|
+
/** Passphrase for an encrypted HTTPS private key or PFX. */
|
|
708
805
|
httpsServerPassphrase?: string;
|
|
806
|
+
/** Secure protocol string passed to Node.js https.createServer (e.g. "TLSv1_2_method"). */
|
|
709
807
|
httpsServerSecureProtocol?: string;
|
|
808
|
+
/** Numeric TLS options bitmask passed to Node.js https.createServer. */
|
|
710
809
|
httpsServerSecureOptions?: number;
|
|
810
|
+
/** Cipher suite string (OpenSSL format) for the HTTPS server. */
|
|
711
811
|
httpsServerCiphers?: string;
|
|
812
|
+
/** When true, the server's cipher order takes precedence over the client's. */
|
|
712
813
|
httpsServerHonorCipherOrder?: boolean;
|
|
814
|
+
/** When true, the server requests a client certificate. */
|
|
713
815
|
httpsServerRequestCert?: boolean;
|
|
816
|
+
/** When false, self-signed or untrusted client certificates are accepted. */
|
|
714
817
|
httpsServerRejectUnauthorized?: boolean;
|
|
715
818
|
/**
|
|
716
819
|
* When true, this project is the preferred project for its connected repository.
|
|
@@ -720,23 +823,35 @@ export interface Project {
|
|
|
720
823
|
/** Single tenancy config ID for this project. Overrides the space-level defaultSingleTenancyConfig.
|
|
721
824
|
* References a document in the singleTenancyConfigurations collection. */
|
|
722
825
|
singleTenancyConfig?: string;
|
|
826
|
+
/** Password-protect the preview URL. */
|
|
723
827
|
previewPasswordProtection?: PreviewPasswordProtection;
|
|
724
828
|
};
|
|
829
|
+
/** URL of the project's screenshot thumbnail, or null if none has been captured. */
|
|
725
830
|
screenshot: string | null;
|
|
831
|
+
/** When true, this project is a built-in example shown to new users. */
|
|
726
832
|
isExample?: boolean;
|
|
833
|
+
/** When true, the project is publicly accessible without authentication. */
|
|
727
834
|
isPublic?: boolean;
|
|
835
|
+
/** Volume snapshot metadata for restoring container state. */
|
|
728
836
|
snapshotVolume?: {
|
|
837
|
+
/** Fly.io volume identifier. */
|
|
729
838
|
volumeId: string;
|
|
839
|
+
/** Fly.io app name associated with the snapshot. */
|
|
730
840
|
appName: string;
|
|
841
|
+
/** Unix timestamp (ms) when the snapshot was created. */
|
|
731
842
|
createdAt: number;
|
|
732
843
|
};
|
|
844
|
+
/** When true, this project was created from a user-defined template. */
|
|
733
845
|
isFromUserTemplate?: boolean;
|
|
846
|
+
/** ID of the template used to create this project, if any. */
|
|
734
847
|
templateId?: string | null;
|
|
848
|
+
/** Local filesystem path for desktop-app projects. */
|
|
735
849
|
localPath?: string | null;
|
|
736
850
|
/** The state of the project. Use `isProjectDeleted()` helper for backwards-compatible checks. */
|
|
737
851
|
state?: EntityState;
|
|
738
852
|
/** MIGRATION: accepts both string and number during migration period */
|
|
739
853
|
deletedAt?: InMigrationDateNullable;
|
|
854
|
+
/** User ID of whoever deleted the project. */
|
|
740
855
|
deletedBy?: string;
|
|
741
856
|
/**
|
|
742
857
|
* When true, branches are stored in the standalone `branches` collection
|
package/src/projects.js
CHANGED
|
@@ -33,6 +33,7 @@ export const EXAMPLE_REPOS = [
|
|
|
33
33
|
"BuilderIO/org-agent-starter",
|
|
34
34
|
];
|
|
35
35
|
export const STARTER_REPO = "BuilderIO/fusion-starter";
|
|
36
|
+
export const DSI_PREVIEW_REPO = "BuilderIO/dsi-starter";
|
|
36
37
|
export const EXAMPLE_OR_STARTER_REPOS = [...EXAMPLE_REPOS, STARTER_REPO];
|
|
37
38
|
export const EXAMPLE_OR_STARTER_REPOS_URLS = EXAMPLE_OR_STARTER_REPOS.map((repo) => `https://github.com/${repo}`);
|
|
38
39
|
export const checkIsNewBranch = (branch) => {
|