@builder.io/ai-utils 0.17.1 → 0.17.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.17.1",
3
+ "version": "0.17.3",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -44,6 +44,7 @@ export interface CustomAgentDefinition {
44
44
  needDevServer?: boolean;
45
45
  needValidation?: boolean;
46
46
  includeMemories?: boolean;
47
+ resetAfterRun?: boolean;
47
48
  }
48
49
  export type CodeGenFramework = "react" | "html" | "mitosis" | "react-native" | "angular" | "vue" | "svelte" | "qwik" | "solid" | "marko" | "swiftui" | "jetpack-compose" | "flutter";
49
50
  export type CodeGenStyleLibrary = "tailwind" | "tailwind-precise" | "emotion" | "styled-components" | "styled-jsx" | "react-native" | undefined;
@@ -153,6 +154,7 @@ export interface AgentToolInput {
153
154
  description: string;
154
155
  prompt: string;
155
156
  subagent_type?: string;
157
+ resume?: string;
156
158
  }
157
159
  export interface ListDirToolInput {
158
160
  path: string;
@@ -348,7 +350,7 @@ export interface CodeGenInputOptions {
348
350
  /** @deprecated */
349
351
  systemReminderPrompt?: string;
350
352
  }
351
- export type CodeGenErrorCodes = "credits-limit-daily" | "credits-limit-monthly" | "credits-limit-other" | "cli-genetic-error" | "git-update-error" | "prompt-too-long" | "context-too-long" | "abrupt-end" | "unknown" | "failed-recover-state" | "completion-expired" | "ask-to-continue" | "bad-initial-url" | "invalid-last-message" | "corrupted-session" | "privacy-mode-key-required" | "privacy-mode-key-invalid" | "cli-network-error" | "assertion" | "rate-limit" | "unknown-design-system";
353
+ export type CodeGenErrorCodes = "credits-limit-daily" | "credits-limit-monthly" | "credits-limit-other" | "cli-genetic-error" | "git-update-error" | "prompt-too-long" | "context-too-long" | "abrupt-end" | "unknown" | "failed-recover-state" | "completion-expired" | "ask-to-continue" | "bad-initial-url" | "bad-smart-export-payload" | "invalid-last-message" | "corrupted-session" | "privacy-mode-key-required" | "privacy-mode-key-invalid" | "cli-network-error" | "assertion" | "rate-limit" | "unknown-design-system";
352
354
  export interface CodegenUsage {
353
355
  total: number;
354
356
  fast: number;
@@ -1251,6 +1253,12 @@ export interface FusionConfig {
1251
1253
  * These are merged with filesystem-discovered agents.
1252
1254
  */
1253
1255
  customAgents?: CustomAgentDefinition[];
1256
+ /**
1257
+ * Agent type to initialize the session as.
1258
+ * When specified, the session will be configured with settings from the named agent.
1259
+ * Useful for direct agent initialization without going through spawnAgent.
1260
+ */
1261
+ agentType?: string;
1254
1262
  /**
1255
1263
  * Array of regex patterns to ignore when checking for client-side errors.
1256
1264
  * Errors matching these patterns will not show the error popup.
@@ -1637,3 +1645,8 @@ export interface SystemReminderObj {
1637
1645
  ephemeral?: boolean;
1638
1646
  }
1639
1647
  export type SystemReminder = string | SystemReminderObj;
1648
+ export interface LaunchInitializeSessionOptions {
1649
+ sessionId?: string;
1650
+ customInstructions?: CustomInstruction[];
1651
+ privacyMode?: PrivacyMode;
1652
+ }
package/src/projects.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { FileOverride, EnvironmentVariable, LaunchServerState, LaunchServerStatus, BranchBackup, CommitMode } from "./codegen";
1
+ import type { FileOverride, EnvironmentVariable, LaunchServerState, LaunchServerStatus, BranchBackup, CommitMode, CustomInstruction, CustomAgentDefinition } from "./codegen";
2
2
  /**
3
3
  * Temporary type for date fields during migration.
4
4
  * Handles both old (string) and new (number) formats.
@@ -290,7 +290,7 @@ export interface PartialBranchData {
290
290
  branchName: string;
291
291
  };
292
292
  }
293
- export type EntityState = "active" | "deleted";
293
+ export type EntityState = "active" | "deleted" | "archived";
294
294
  /**
295
295
  * Metadata stored in branches for integration tracking and PR description generation.
296
296
  * This type documents the integration context that can be attached to a branch.
@@ -314,7 +314,7 @@ export interface BranchMetadata {
314
314
  slackThreadTs?: string;
315
315
  [key: string]: unknown;
316
316
  }
317
- export type PRStatus = "open" | "closed" | "merged" | "draft";
317
+ export type PRStatus = "open" | "closed" | "merged" | "draft" | "approved";
318
318
  interface BranchSharedData {
319
319
  appName?: string | null;
320
320
  prNumber?: number | null;
@@ -332,6 +332,7 @@ interface BranchSharedData {
332
332
  lastServerStateDate?: number | null;
333
333
  lastServerVersion?: string | null;
334
334
  name?: string;
335
+ agentType?: string | null;
335
336
  createdBy?: string;
336
337
  isPublic?: boolean;
337
338
  isDefault?: boolean;
@@ -481,6 +482,8 @@ export interface Project {
481
482
  includePatterns?: string[];
482
483
  environmentVariables?: EnvironmentVariable[];
483
484
  fileOverrides?: FileOverride[];
485
+ customInstructions?: CustomInstruction[];
486
+ customAgents?: CustomAgentDefinition[];
484
487
  commitMode?: CommitMode;
485
488
  defaultBranchType?: "shared" | "private";
486
489
  dockerImagePath?: string;
@@ -557,8 +560,13 @@ export declare const getBranchState: (branch: Branch) => EntityState;
557
560
  export declare const getProjectState: (project: Project) => EntityState;
558
561
  /**
559
562
  * Check if a branch is deleted, supporting both `state` and legacy `deleted` fields.
563
+ * Note: Archived branches are NOT considered deleted.
560
564
  */
561
565
  export declare const isBranchDeleted: (branch: Branch) => boolean;
566
+ /**
567
+ * Check if a branch is archived.
568
+ */
569
+ export declare const isBranchArchived: (branch: Branch) => boolean;
562
570
  /**
563
571
  * Check if a project is deleted, supporting both `state` and legacy `deleted` fields.
564
572
  */
package/src/projects.js CHANGED
@@ -30,10 +30,17 @@ export const getProjectState = (project) => {
30
30
  };
31
31
  /**
32
32
  * Check if a branch is deleted, supporting both `state` and legacy `deleted` fields.
33
+ * Note: Archived branches are NOT considered deleted.
33
34
  */
34
35
  export const isBranchDeleted = (branch) => {
35
36
  return getBranchState(branch) === "deleted";
36
37
  };
38
+ /**
39
+ * Check if a branch is archived.
40
+ */
41
+ export const isBranchArchived = (branch) => {
42
+ return getBranchState(branch) === "archived";
43
+ };
37
44
  /**
38
45
  * Check if a project is deleted, supporting both `state` and legacy `deleted` fields.
39
46
  */