@builder.io/ai-utils 0.5.40 → 0.6.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.5.40",
3
+ "version": "0.6.0",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -191,6 +191,8 @@ export interface CodeGenToolMap {
191
191
  export type CodeGenTools = keyof CodeGenToolMap;
192
192
  export type AllCodeGenTools = CodeGenTools | "web_search";
193
193
  export type CodeGenMode = "quality" | "quality-v3" | "quality-v4" | "quality-v4-agent";
194
+ export type BaseCodeGenPosition = "fusion" | "editor-ai" | "repo-indexing" | "cli" | "create-app-firebase" | "create-app-lovable" | "builder-code-panel";
195
+ export type CodeGenPosition = BaseCodeGenPosition | `${BaseCodeGenPosition}-agent`;
194
196
  export interface RepoIndexingConfig {
195
197
  designSystems: string[];
196
198
  }
@@ -247,7 +249,7 @@ export interface CodeGenInputOptions {
247
249
  /** @deprecated */
248
250
  vcpId?: string;
249
251
  }
250
- export type CodeGenErrorCodes = "credits-limit-daily" | "credits-limit-monthly" | "credits-limit-other" | "cli-genetic-error" | "git-update-error" | "prompt-too-long" | "context-too-long" | "unknown" | "failed-recover-state" | "ask-to-continue" | "bad-initial-url" | "invalid-last-message" | "corrupted-session" | "assertion" | "rate-limit";
252
+ export type CodeGenErrorCodes = "credits-limit-daily" | "credits-limit-monthly" | "credits-limit-other" | "cli-genetic-error" | "git-update-error" | "prompt-too-long" | "context-too-long" | "unknown" | "failed-recover-state" | "ask-to-continue" | "bad-initial-url" | "invalid-last-message" | "corrupted-session" | "assertion" | "rate-limit" | "unknown-design-system";
251
253
  export type Feature = "component-mapping";
252
254
  export interface CodegenUsage {
253
255
  total: number;
@@ -673,6 +675,7 @@ export interface CodegenFeedback {
673
675
  afterCommit?: string;
674
676
  linesOfCodeAdded?: number;
675
677
  linesOfCodeRemoved?: number;
678
+ position?: CodeGenPosition;
676
679
  }
677
680
  export interface CodegenSetLastCompletion {
678
681
  sessionId: string;
@@ -762,20 +765,26 @@ export interface BranchBackup {
762
765
  version?: "v1" | "v2";
763
766
  }
764
767
  export interface CheckBackupDataResultValid {
765
- hasValidBackup: true;
768
+ state: "valid";
766
769
  outcome: "valid";
767
770
  message: string;
768
771
  backup: BranchBackup;
769
772
  }
773
+ export interface CheckBackupDataResultStale {
774
+ state: "stale";
775
+ outcome: "hash-mismatch";
776
+ message: string;
777
+ backup: BranchBackup;
778
+ }
770
779
  export interface CheckBackupDataResultInvalid {
771
- hasValidBackup: false;
772
- outcome: "no-backup" | "hash-mismatch" | "error" | "not-completed" | "no-session-id" | "no-last-commit-hash" | "no-backup-file" | "empty-full-backup" | "no-vcpCodeGenEvent" | "no-after-commit" | "no-signed-url" | "no-git-branch-name" | "repo-url-mismatch" | "branch-uninitialized" | "unexpected-partial-backup" | "unexpected-full-backup";
780
+ state: "invalid";
781
+ outcome: "no-backup" | "error" | "not-completed" | "no-session-id" | "no-last-commit-hash" | "no-backup-file" | "empty-full-backup" | "no-vcpCodeGenEvent" | "no-after-commit" | "no-signed-url" | "no-git-branch-name" | "repo-url-mismatch" | "branch-uninitialized" | "unexpected-partial-backup" | "unexpected-full-backup";
773
782
  message: string;
774
783
  backup: BranchBackup | undefined;
775
784
  }
776
- export type CheckBackupDataResult = CheckBackupDataResultValid | CheckBackupDataResultInvalid;
785
+ export type CheckBackupDataResult = CheckBackupDataResultValid | CheckBackupDataResultStale | CheckBackupDataResultInvalid;
777
786
  export interface BackupMetadata {
778
- check: CheckBackupDataResultValid;
787
+ check: CheckBackupDataResultValid | CheckBackupDataResultStale;
779
788
  downloadUrl: GitBackupDownloadUrlResult | undefined;
780
789
  }
781
790
  export interface WorkspaceFolder {
@@ -925,7 +934,7 @@ export interface InitState {
925
934
  branch: string;
926
935
  }[];
927
936
  }
928
- export type LaunchServerState = "initial" | "init-running" | "init-complete" | "ready" | "active-session" | "error" | "closing";
937
+ export type LaunchServerState = "initial" | "init-running" | "init-complete" | "ready" | "active-session" | "init-error" | "session-error" | "error" | "closing";
929
938
  export interface LaunchServerStatus {
930
939
  status: "ok";
931
940
  state: LaunchServerState;
package/src/messages.d.ts CHANGED
@@ -28,6 +28,7 @@ export interface DocumentBase64Source {
28
28
  type: "base64";
29
29
  media_type: "application/pdf";
30
30
  data: string;
31
+ original_url?: string;
31
32
  }
32
33
  export interface DocumentUrlSource {
33
34
  type: "url";
@@ -53,6 +54,7 @@ export interface ImageBase64Source {
53
54
  type: "base64";
54
55
  media_type: "image/webp" | "image/png" | "image/jpeg" | "image/gif";
55
56
  data: string;
57
+ original_url?: string;
56
58
  }
57
59
  export interface ImageUrlSource {
58
60
  type: "url";
@@ -35,6 +35,7 @@ interface StoreComponentDocsInputV2 {
35
35
  sessionId: string;
36
36
  hash?: string;
37
37
  designSystemId?: string;
38
+ tokens?: number;
38
39
  }
39
40
  export type DesignSystemScope = "space" | "organization" | "global";
40
41
  export interface AddDesignSystemInput {