@builder.io/ai-utils 0.76.4 → 0.77.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.76.4",
3
+ "version": "0.77.0",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
package/src/codegen.d.ts CHANGED
@@ -837,6 +837,8 @@ export declare const ProposedConfigSchema: z.ZodObject<{
837
837
  createdAt: z.ZodNumber;
838
838
  updatedAt: z.ZodNumber;
839
839
  ownerId: z.ZodString;
840
+ userInitiated: z.ZodBoolean;
841
+ autoApply: z.ZodBoolean;
840
842
  state: z.ZodEnum<{
841
843
  "code-change-required": "code-change-required";
842
844
  "empty-project": "empty-project";
@@ -2897,7 +2899,7 @@ export type CodeGenInputOptions = z.infer<typeof CodeGenInputOptionsSchema> & {
2897
2899
  */
2898
2900
  _mcpClientWrapperFactory?: (realClient: any) => any;
2899
2901
  };
2900
- export type CodeGenErrorCodes = "credits-limit-daily" | "credits-limit-monthly" | "credits-limit-user" | "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" | "invalid-credentials" | "model-restricted-too-large" | "org-no-models-enabled" | "assertion" | "rate-limit" | "unknown-design-system";
2902
+ export type CodeGenErrorCodes = "credits-limit-daily" | "credits-limit-monthly" | "credits-limit-user" | "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" | "privacy-mode-key-mismatch" | "cli-network-error" | "invalid-credentials" | "model-restricted-too-large" | "org-no-models-enabled" | "assertion" | "rate-limit" | "unknown-design-system";
2901
2903
  export interface CodegenUsage {
2902
2904
  total: number;
2903
2905
  fast: number;
@@ -3700,6 +3702,25 @@ export interface GetSessionTurnsResult {
3700
3702
  sessionMode?: SessionMode;
3701
3703
  hasPlanToApply?: boolean;
3702
3704
  metadata?: Record<string, any>;
3705
+ /** SHA-256(JWK) of the key this session is encrypted with. Presence ⟹ private. */
3706
+ encryptKeyHash?: string;
3707
+ /** Org requires new sessions to be private; derived per-request, not stored. */
3708
+ privacyModeRequired?: boolean;
3709
+ }
3710
+ /**
3711
+ * Body for `POST /codegen/settings`. All context is optional; the server
3712
+ * resolves settings for the narrowest scope it can, falling back to org.
3713
+ */
3714
+ export declare const CodegenSettingsRequestSchema: z.ZodObject<{
3715
+ sessionId: z.ZodOptional<z.ZodString>;
3716
+ projectName: z.ZodOptional<z.ZodString>;
3717
+ branchName: z.ZodOptional<z.ZodString>;
3718
+ repoHash: z.ZodOptional<z.ZodString>;
3719
+ }, z.core.$strip>;
3720
+ export type CodegenSettingsRequest = z.infer<typeof CodegenSettingsRequestSchema>;
3721
+ /** Load-independent client settings. v1 carries only the privacy gate. */
3722
+ export interface CodegenSettingsResult {
3723
+ privacyModeRequired?: boolean;
3703
3724
  }
3704
3725
  export interface CodegenFeedback {
3705
3726
  id: string;
@@ -4787,5 +4808,10 @@ export interface SessionData {
4787
4808
  numUserMessages: number;
4788
4809
  numNormalUserMessages: number;
4789
4810
  metadata?: Record<string, any>;
4811
+ /**
4812
+ * SHA-256(JWK) of the encryption key this session is encrypted with.
4813
+ * Presence makes the session private (sticky — no downgrade to plaintext).
4814
+ */
4815
+ encryptKeyHash?: string;
4790
4816
  }
4791
4817
  export {};
package/src/codegen.js CHANGED
@@ -1025,6 +1025,8 @@ export const ProposedConfigSchema = z
1025
1025
  createdAt: z.number(),
1026
1026
  updatedAt: z.number(),
1027
1027
  ownerId: z.string(),
1028
+ userInitiated: z.boolean(),
1029
+ autoApply: z.boolean(),
1028
1030
  state: ExitStateSchema.meta({
1029
1031
  description: "Configuration state from Exit tool",
1030
1032
  }),
@@ -1976,6 +1978,18 @@ export const GenerateUserMessageSchema = z
1976
1978
  }),
1977
1979
  })
1978
1980
  .meta({ title: "GenerateUserMessage" });
1981
+ /**
1982
+ * Body for `POST /codegen/settings`. All context is optional; the server
1983
+ * resolves settings for the narrowest scope it can, falling back to org.
1984
+ */
1985
+ export const CodegenSettingsRequestSchema = z
1986
+ .object({
1987
+ sessionId: z.string().optional(),
1988
+ projectName: z.string().optional(),
1989
+ branchName: z.string().optional(),
1990
+ repoHash: z.string().optional(),
1991
+ })
1992
+ .meta({ title: "CodegenSettingsRequest" });
1979
1993
  /**
1980
1994
  * Request for generating a commit message via LLM
1981
1995
  */
package/src/projects.d.ts CHANGED
@@ -229,6 +229,7 @@ export type GitConfigs = Record<string, GitConfig>;
229
229
  export declare const EXAMPLE_REPOS: string[];
230
230
  export declare const STARTER_REPO = "BuilderIO/fusion-starter";
231
231
  export declare const DSI_PREVIEW_REPO = "BuilderIO/dsi-starter";
232
+ export declare const AGENT_NATIVE_STARTER_REPO = "BuilderIO/builder-agent-native-starter";
232
233
  export declare const EXAMPLE_OR_STARTER_REPOS: string[];
233
234
  export declare const EXAMPLE_OR_STARTER_REPOS_URLS: string[];
234
235
  export interface GitBackupUploadUrlResult {
package/src/projects.js CHANGED
@@ -36,10 +36,12 @@ export const EXAMPLE_REPOS = [
36
36
  ];
37
37
  export const STARTER_REPO = "BuilderIO/fusion-starter";
38
38
  export const DSI_PREVIEW_REPO = "BuilderIO/dsi-starter";
39
+ export const AGENT_NATIVE_STARTER_REPO = "BuilderIO/builder-agent-native-starter";
39
40
  export const EXAMPLE_OR_STARTER_REPOS = [
40
41
  ...EXAMPLE_REPOS,
41
42
  STARTER_REPO,
42
43
  DSI_PREVIEW_REPO,
44
+ AGENT_NATIVE_STARTER_REPO,
43
45
  ];
44
46
  export const EXAMPLE_OR_STARTER_REPOS_URLS = EXAMPLE_OR_STARTER_REPOS.map((repo) => `https://github.com/${repo}`);
45
47
  export const checkIsNewBranch = (branch) => {