@builder.io/ai-utils 0.12.0 → 0.12.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -28,6 +28,17 @@ export interface CustomInstruction {
28
28
  glob?: string;
29
29
  description?: string;
30
30
  }
31
+ export interface CustomAgentInfo {
32
+ name: string;
33
+ description?: string;
34
+ }
35
+ export interface CustomAgentDefinition {
36
+ name: string;
37
+ description?: string;
38
+ systemPrompt?: string;
39
+ tools?: string[];
40
+ model?: string;
41
+ }
31
42
  export type CodeGenFramework = "react" | "html" | "mitosis" | "react-native" | "angular" | "vue" | "svelte" | "qwik" | "solid" | "marko" | "swiftui" | "jetpack-compose" | "flutter";
32
43
  export type CodeGenStyleLibrary = "tailwind" | "tailwind-precise" | "emotion" | "styled-components" | "styled-jsx" | "react-native" | undefined;
33
44
  export type CompletionStopReason = "max_tokens" | "stop_sequence" | "tool_use" | "end_turn" | "content_filter" | "error" | "aborted" | "pause_turn" | "refusal" | "model_context_window_exceeded" | null;
@@ -125,6 +136,7 @@ export interface AskUserQuestionToolInput {
125
136
  export interface AgentToolInput {
126
137
  description: string;
127
138
  prompt: string;
139
+ subagent_type?: string;
128
140
  }
129
141
  export interface ListDirToolInput {
130
142
  path: string;
@@ -235,6 +247,8 @@ export interface CodeGenInputOptions {
235
247
  diffActions?: boolean;
236
248
  planningPrompt?: boolean;
237
249
  customInstructions?: CustomInstruction[];
250
+ customAgents?: CustomAgentInfo[];
251
+ systemPromptOverride?: string;
238
252
  userPrompt?: string;
239
253
  ephemeralUserPrompt?: string;
240
254
  uiContextPrompt?: string;
@@ -991,6 +1005,13 @@ export interface FileOverride {
991
1005
  */
992
1006
  content: string;
993
1007
  }
1008
+ export interface MCPServerDefinition {
1009
+ command: string;
1010
+ args?: string[];
1011
+ env?: Record<string, string>;
1012
+ envFile?: string;
1013
+ }
1014
+ export type MCPServerConfig = Record<string, MCPServerDefinition>;
994
1015
  export interface FusionConfig {
995
1016
  devCommand?: string;
996
1017
  checkCommand?: string;
@@ -1072,16 +1093,21 @@ export interface FusionConfig {
1072
1093
  * Servers defined here will be merged with servers from mcp.json.
1073
1094
  * Supports environment variable substitution using ${VAR_NAME} syntax.
1074
1095
  */
1075
- mcpServers?: Record<string, {
1076
- command: string;
1077
- args?: string[];
1078
- env?: Record<string, string>;
1079
- envFile?: string;
1080
- }>;
1096
+ mcpServers?: MCPServerConfig;
1081
1097
  /**
1082
1098
  * List of built-in tools to disable.
1083
1099
  */
1084
1100
  disabledTools?: string[];
1101
+ /**
1102
+ * Custom instructions/rules to inject into the code generation session.
1103
+ * These are merged with filesystem-discovered custom instructions.
1104
+ */
1105
+ customInstructions?: CustomInstruction[];
1106
+ /**
1107
+ * Custom agents to inject into the code generation session.
1108
+ * These are merged with filesystem-discovered agents.
1109
+ */
1110
+ customAgents?: CustomAgentDefinition[];
1085
1111
  /** @deprecated use devCommand */
1086
1112
  command?: string;
1087
1113
  }
@@ -1210,6 +1236,21 @@ export interface CodegenApiFailure {
1210
1236
  message: string;
1211
1237
  error: Error;
1212
1238
  }
1239
+ export interface CodegenApiCreateTerminal {
1240
+ terminalId?: string;
1241
+ title?: string;
1242
+ cwd?: string;
1243
+ env?: Record<string, string | undefined>;
1244
+ cols?: number;
1245
+ rows?: number;
1246
+ shell?: string;
1247
+ createdBy?: string;
1248
+ initialCommand?: string;
1249
+ readonly?: boolean;
1250
+ inheritCredentials?: boolean;
1251
+ emitTerminals?: boolean;
1252
+ force?: boolean;
1253
+ }
1213
1254
  export interface CodegenApiTerminal {
1214
1255
  terminalId: string;
1215
1256
  title: string;
@@ -1219,6 +1260,9 @@ export interface CodegenApiTerminal {
1219
1260
  createdBy: string;
1220
1261
  readonly: boolean;
1221
1262
  builtIn: boolean;
1263
+ state: "starting" | "running" | "exited" | "error";
1264
+ exitCode: number | undefined;
1265
+ initialCommand?: string;
1222
1266
  }
1223
1267
  export interface SetupCommandResult {
1224
1268
  code: number | null;
@@ -49,6 +49,7 @@ interface RoleOptions {
49
49
  editContentPriority?: boolean;
50
50
  editFolders?: boolean;
51
51
  indexDesignSystems?: boolean;
52
+ modifyWorkflowIntegrations?: boolean;
52
53
  }
53
54
  interface RoleEnvironment {
54
55
  pushAllowedOrgIds?: string[];
@@ -67,6 +68,7 @@ export interface ProjectRole {
67
68
  createBranches?: boolean;
68
69
  modifyMcpServers?: boolean;
69
70
  modifyProjectSettings?: boolean;
71
+ modifyWorkflowIntegrations?: boolean;
70
72
  };
71
73
  }
72
74
  export interface Limits {
package/src/projects.d.ts CHANGED
@@ -327,6 +327,19 @@ export interface Branch {
327
327
  }
328
328
  export type CpuKind = "performance" | "shared";
329
329
  export type MachineAutoStop = "stop" | "off" | "suspend";
330
+ export interface ProjectRolePermissions {
331
+ view?: boolean;
332
+ editCode?: boolean;
333
+ sendPullRequests?: boolean;
334
+ createBranches?: boolean;
335
+ modifyMcpServers?: boolean;
336
+ modifyWorkflowIntegrations?: boolean;
337
+ modifyProjectSettings?: boolean;
338
+ }
339
+ export interface ProjectAccessControl {
340
+ roles: Record<string, ProjectRolePermissions | null>;
341
+ users: Record<string, ProjectRolePermissions>;
342
+ }
330
343
  export interface Project {
331
344
  id: string;
332
345
  name: string;
@@ -346,7 +359,10 @@ export interface Project {
346
359
  repoAddedBy?: string;
347
360
  pipelineCounts?: Record<string, number>;
348
361
  needSetup?: boolean;
362
+ projectType?: "app" | "repo-indexing";
349
363
  domains?: string[];
364
+ accessMode?: "public" | "private";
365
+ projectAccess?: ProjectAccessControl;
350
366
  settings: {
351
367
  isNativeApp?: boolean;
352
368
  autoDetectDevServer?: boolean;
@@ -1,5 +1,5 @@
1
1
  export type StoreComponentDocsInput = StoreComponentDocsInputV1 | StoreComponentDocsInputV2 | IndexDocumentV1;
2
- export type IndexDocumentV1 = ComponentDocument | TokenDocument | IconDocument | AgentDocument;
2
+ export type IndexDocumentV1 = ComponentDocument | TokenDocument | IconDocument | AgentDocument | InstallationDocument;
3
3
  export interface ComponentDocument extends DocumentBase {
4
4
  type: "component";
5
5
  relatedComponents: string[];
@@ -18,6 +18,10 @@ export interface IconDocument extends DocumentBase {
18
18
  export interface AgentDocument extends DocumentBase {
19
19
  type: "agent";
20
20
  }
21
+ export interface InstallationDocument extends DocumentBase {
22
+ type: "installation";
23
+ hash: string;
24
+ }
21
25
  export interface DocumentBase {
22
26
  id?: string;
23
27
  name: string;
@@ -33,6 +37,7 @@ export declare const isAgentDocument: (doc: IndexDocumentV1) => doc is AgentDocu
33
37
  export declare const isIconDocument: (doc: IndexDocumentV1) => doc is IconDocument;
34
38
  export declare const isTokenDocument: (doc: IndexDocumentV1) => doc is TokenDocument;
35
39
  export declare const isComponentDocument: (doc: IndexDocumentV1) => doc is ComponentDocument;
40
+ export declare const isInstallationDocument: (doc: IndexDocumentV1) => doc is InstallationDocument;
36
41
  /**
37
42
  * @deprecated
38
43
  * While some documents may still use this format, new documents should use the
@@ -10,3 +10,6 @@ export const isTokenDocument = (doc) => {
10
10
  export const isComponentDocument = (doc) => {
11
11
  return doc.type === "component";
12
12
  };
13
+ export const isInstallationDocument = (doc) => {
14
+ return doc.type === "installation";
15
+ };