@builder.io/ai-utils 0.5.41 → 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.41",
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
@@ -249,7 +249,7 @@ export interface CodeGenInputOptions {
249
249
  /** @deprecated */
250
250
  vcpId?: string;
251
251
  }
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";
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";
253
253
  export type Feature = "component-mapping";
254
254
  export interface CodegenUsage {
255
255
  total: number;
@@ -765,20 +765,26 @@ export interface BranchBackup {
765
765
  version?: "v1" | "v2";
766
766
  }
767
767
  export interface CheckBackupDataResultValid {
768
- hasValidBackup: true;
768
+ state: "valid";
769
769
  outcome: "valid";
770
770
  message: string;
771
771
  backup: BranchBackup;
772
772
  }
773
+ export interface CheckBackupDataResultStale {
774
+ state: "stale";
775
+ outcome: "hash-mismatch";
776
+ message: string;
777
+ backup: BranchBackup;
778
+ }
773
779
  export interface CheckBackupDataResultInvalid {
774
- hasValidBackup: false;
775
- 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";
776
782
  message: string;
777
783
  backup: BranchBackup | undefined;
778
784
  }
779
- export type CheckBackupDataResult = CheckBackupDataResultValid | CheckBackupDataResultInvalid;
785
+ export type CheckBackupDataResult = CheckBackupDataResultValid | CheckBackupDataResultStale | CheckBackupDataResultInvalid;
780
786
  export interface BackupMetadata {
781
- check: CheckBackupDataResultValid;
787
+ check: CheckBackupDataResultValid | CheckBackupDataResultStale;
782
788
  downloadUrl: GitBackupDownloadUrlResult | undefined;
783
789
  }
784
790
  export interface WorkspaceFolder {
@@ -928,7 +934,7 @@ export interface InitState {
928
934
  branch: string;
929
935
  }[];
930
936
  }
931
- 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";
932
938
  export interface LaunchServerStatus {
933
939
  status: "ok";
934
940
  state: LaunchServerState;
@@ -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 {