@builder.io/ai-utils 0.103.0 → 0.106.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.103.0",
3
+ "version": "0.106.0",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
package/src/codegen.d.ts CHANGED
@@ -2317,7 +2317,9 @@ export declare const PublishAgentMessageRequestSchema: z.ZodObject<{
2317
2317
  tag: z.ZodOptional<z.ZodString>;
2318
2318
  ephemeral: z.ZodOptional<z.ZodBoolean>;
2319
2319
  }, z.core.$strip>]>>>;
2320
+ requireConfirmation: z.ZodOptional<z.ZodBoolean>;
2320
2321
  skippedMCPs: z.ZodOptional<z.ZodArray<z.ZodString>>;
2322
+ customInstructions: z.ZodOptional<z.ZodString>;
2321
2323
  }, z.core.$strip>;
2322
2324
  export type PublishAgentMessageRequest = z.infer<typeof PublishAgentMessageRequestSchema>;
2323
2325
  export declare const RepoIndexingConfigSchema: z.ZodObject<{
@@ -4324,6 +4326,12 @@ export interface WorkspaceFolder {
4324
4326
  templateRepoUrl?: string;
4325
4327
  repoName?: string;
4326
4328
  resetGit?: boolean;
4329
+ /**
4330
+ * The project's configured base/default branch (e.g. "main", "master"),
4331
+ * distinct from `branchName` (the feature branch this folder checks out).
4332
+ * Used when seeding or checking the base branch on the real remote.
4333
+ */
4334
+ mainBranchName?: string;
4327
4335
  branchName?: string;
4328
4336
  backupMetadata?: BackupMetadata;
4329
4337
  initializationCommand?: string;
@@ -4675,7 +4683,7 @@ export interface LoadHistoryResult {
4675
4683
  updatedUnixTime: number;
4676
4684
  turns: CodegenTurn[];
4677
4685
  }
4678
- export type InitStateStep = "initial" | "init" | "validation" | "check-directories" | "create-directories" | "configure-git-repos" | "check-existing-git" | "update-remote-url" | "clone-repo" | "apply-partial-backup" | "configure-git-user" | "stash-changes" | "collect-repo-info" | "init-success" | "init-command" | "init-failed" | "snapshot-git-sync" | "snapshot-backup-restore" | "git-corruption-recovery";
4686
+ export type InitStateStep = "initial" | "init" | "validation" | "check-directories" | "create-directories" | "configure-git-repos" | "check-existing-git" | "update-remote-url" | "clone-repo" | "apply-partial-backup" | "configure-git-user" | "stash-changes" | "collect-repo-info" | "init-success" | "init-command" | "init-failed" | "snapshot-git-sync" | "snapshot-backup-restore" | "git-corruption-recovery" | "seed-base-branch";
4679
4687
  export interface InitStatusLog {
4680
4688
  id: number;
4681
4689
  timestamp: string;
@@ -5130,6 +5138,35 @@ export type MessageUpdateOptions = {
5130
5138
  type: "delete";
5131
5139
  idempotencyKey: string;
5132
5140
  };
5141
+ /**
5142
+ * Args for the `writeFile` launch-server RPC.
5143
+ *
5144
+ * A named-args object because the RPC applies arguments by position and the
5145
+ * container's pinned `dev-tools` rarely matches the caller's, so new fields
5146
+ * have to be additive rather than order-sensitive.
5147
+ */
5148
+ export interface WriteFileOptions {
5149
+ /** Workspace-relative, e.g. `docs/NOTES.md`. */
5150
+ path: string;
5151
+ contents: string;
5152
+ }
5153
+ /**
5154
+ * Discriminated rather than a nullable path, so a caller that gates behaviour
5155
+ * on the write can tell a refusal from a write that never happened, instead of
5156
+ * reading `null` as both.
5157
+ *
5158
+ * Gate on `success`, not on parsing `error`. Only an ACL denial is reported
5159
+ * distinctly; a blocked `package.json`, a path outside the workspace and a
5160
+ * filesystem error all share one generic message, their reason reaching only
5161
+ * Sentry.
5162
+ */
5163
+ export type WriteFileResult = {
5164
+ success: true;
5165
+ path: string;
5166
+ } | {
5167
+ success: false;
5168
+ error: string;
5169
+ };
5133
5170
  export interface LaunchInitializeSessionOptions {
5134
5171
  sessionId?: string;
5135
5172
  customInstructions?: CustomInstruction[];
package/src/codegen.js CHANGED
@@ -1818,9 +1818,15 @@ export const PublishAgentMessageRequestSchema = z
1818
1818
  attachments: z.array(AttachmentSchema).optional(),
1819
1819
  toolResults: z.array(ContentMessageItemToolResultSchema).optional(),
1820
1820
  systemReminders: z.array(SystemReminderSchema).optional(),
1821
+ requireConfirmation: z.boolean().optional().meta({
1822
+ description: "Ask before high-impact MCP tool calls; the turn emits confirmation_required and waits.",
1823
+ }),
1821
1824
  skippedMCPs: z.array(z.string()).optional().meta({
1822
1825
  description: "Per-message denylist of MCP server ids to skip, e.g. a 'disable for this session' UI toggle.",
1823
1826
  }),
1827
+ customInstructions: z.string().max(100000).optional().meta({
1828
+ description: "The organization's Publish Agent instructions, applied as an always-on rule. Send on every request, including tool-result continuations.",
1829
+ }),
1824
1830
  })
1825
1831
  .refine(({ message, toolResults }) => Boolean(message) || Boolean(toolResults === null || toolResults === void 0 ? void 0 : toolResults.length), {
1826
1832
  path: ["message"],
@@ -266,3 +266,13 @@ export declare const listPublicSourceFilesQuerySchema: z.ZodObject<{
266
266
  ref: z.ZodOptional<z.ZodString>;
267
267
  }, z.core.$strip>;
268
268
  export type ListPublicSourceFilesQuery = z.infer<typeof listPublicSourceFilesQuerySchema>;
269
+ export type DSITier = "free" | "pro" | "team" | "enterprise";
270
+ export interface DSITierLimitResponse {
271
+ tier: DSITier;
272
+ /** Whether this org can index via the web (Figma/.md) flow at its tier. */
273
+ enabled: boolean;
274
+ /** Every active design system the org has, regardless of how it was created. */
275
+ current: number;
276
+ /** `null` is unlimited. */
277
+ max: number | null;
278
+ }
package/src/events.d.ts CHANGED
@@ -943,6 +943,45 @@ export declare const FusionContainerFailedV1: {
943
943
  eventName: "fusion.container.failed";
944
944
  version: "1";
945
945
  };
946
+ /**
947
+ * Why the preview never came up. A closed set so the funnel can group by it;
948
+ * the detail belongs in the container's logs.
949
+ */
950
+ export type FusionPreviewFailureReason = "http-4xx" | "http-5xx" | "unreachable" | "dev-command-failed";
951
+ /**
952
+ * The first moment the user has something to look at. Deliberately not a reuse
953
+ * of `FusionContainerStartedV1`, which only means the box booted: conflating
954
+ * the two makes preview failure unmeasurable, since a container that serves
955
+ * nothing looks identical to a healthy one.
956
+ */
957
+ export type FusionPreviewReadyV1 = FusionEventVariant<"fusion.preview.ready", {
958
+ projectId: string;
959
+ branchName: string;
960
+ /** ms from the dev server being started to its first successful response. */
961
+ durationMs?: number;
962
+ }, {
963
+ projectId: string;
964
+ branchName: string;
965
+ }, 1>;
966
+ export declare const FusionPreviewReadyV1: {
967
+ eventName: "fusion.preview.ready";
968
+ version: "1";
969
+ };
970
+ /** The counterpart to {@link FusionPreviewReadyV1}: the preview never came up. */
971
+ export type FusionPreviewFailedV1 = FusionEventVariant<"fusion.preview.failed", {
972
+ projectId: string;
973
+ branchName: string;
974
+ reason: FusionPreviewFailureReason;
975
+ /** ms from the dev server being started to the failure being called. */
976
+ durationMs?: number;
977
+ }, {
978
+ projectId: string;
979
+ branchName: string;
980
+ }, 1>;
981
+ export declare const FusionPreviewFailedV1: {
982
+ eventName: "fusion.preview.failed";
983
+ version: "1";
984
+ };
946
985
  export type FusionBranchFailedV1 = FusionEventVariant<"fusion.branch.failed", {
947
986
  projectId: string;
948
987
  branchName?: string;
@@ -1460,7 +1499,7 @@ export declare const HostingCustomDomainDelegationCheckV1: {
1460
1499
  eventName: "hosting.custom-domain.delegation-check";
1461
1500
  version: "1";
1462
1501
  };
1463
- export type FusionEvent = ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | ClientDevtoolsToolCallRequestV1 | ClientDevtoolsToolCallV1 | ClientDevtoolsToolResultV1 | ClientDevtoolsBuildMigratedV1 | ClientDevtoolsBuildCompletedV1 | ClientDevtoolsBuildUploadedV1 | ClientDevtoolsBuildFailedV1 | FusionProjectCreatedV1 | FusionShapeIssuedV1 | FusionShapeAssembledV1 | FusionShapeResolvedV1 | FusionShapeQuestionAnsweredV1 | FusionShapeQuestionSkippedV1 | SetupAgentCompletedV1 | GitPrMergedV1 | GitPrCreatedV1 | GitPrClosedV1 | ForceSetupAgentV1 | ClawMessageSentV1 | CodegenCompletionV1 | CodegenUserPromptV1 | GitWebhooksRegisterV1 | FusionProjectSettingsUpdatedV1 | VideoRecordingCompletedV1 | TimelineRecordingReadyV1 | FusionBranchCreatedV1 | FusionContainerStartedV1 | FusionContainerFailedV1 | FusionBranchFailedV1 | BotMentionGitHubExternalPrV1 | BotMentionGitHubInternalPrV1 | BotMentionGitLabPrV1 | BotMentionBitbucketPrV1 | BotMentionAzurePrV1 | ReviewSubmittedV1 | PrReviewRequestedV1 | FigmaDecodeJobV1 | ProjectSnapshotRefreshV1 | ProjectSnapshotGoldenWatchdogV1 | ProjectSnapshotGoldenRetryV1 | ProjectSnapshotCapturedV1 | ProjectSnapshotCreatedV1 | ProjectSnapshotFailedV1 | ProjectSnapshotReadyCheckV1 | ProjectSnapshotPodWatchV1 | McpPrototypePulledV1 | HostingCustomDomainCertCheckV1 | HostingCustomDomainServingCheckV1 | HostingCustomDomainDelegationCheckV1;
1502
+ export type FusionEvent = ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | ClientDevtoolsToolCallRequestV1 | ClientDevtoolsToolCallV1 | ClientDevtoolsToolResultV1 | ClientDevtoolsBuildMigratedV1 | ClientDevtoolsBuildCompletedV1 | ClientDevtoolsBuildUploadedV1 | ClientDevtoolsBuildFailedV1 | FusionProjectCreatedV1 | FusionShapeIssuedV1 | FusionShapeAssembledV1 | FusionShapeResolvedV1 | FusionShapeQuestionAnsweredV1 | FusionShapeQuestionSkippedV1 | SetupAgentCompletedV1 | GitPrMergedV1 | GitPrCreatedV1 | GitPrClosedV1 | ForceSetupAgentV1 | ClawMessageSentV1 | CodegenCompletionV1 | CodegenUserPromptV1 | GitWebhooksRegisterV1 | FusionProjectSettingsUpdatedV1 | VideoRecordingCompletedV1 | TimelineRecordingReadyV1 | FusionBranchCreatedV1 | FusionContainerStartedV1 | FusionContainerFailedV1 | FusionPreviewReadyV1 | FusionPreviewFailedV1 | FusionBranchFailedV1 | BotMentionGitHubExternalPrV1 | BotMentionGitHubInternalPrV1 | BotMentionGitLabPrV1 | BotMentionBitbucketPrV1 | BotMentionAzurePrV1 | ReviewSubmittedV1 | PrReviewRequestedV1 | FigmaDecodeJobV1 | ProjectSnapshotRefreshV1 | ProjectSnapshotGoldenWatchdogV1 | ProjectSnapshotGoldenRetryV1 | ProjectSnapshotCapturedV1 | ProjectSnapshotCreatedV1 | ProjectSnapshotFailedV1 | ProjectSnapshotReadyCheckV1 | ProjectSnapshotPodWatchV1 | McpPrototypePulledV1 | HostingCustomDomainCertCheckV1 | HostingCustomDomainServingCheckV1 | HostingCustomDomainDelegationCheckV1;
1464
1503
  export interface ModelPermissionRequiredEvent {
1465
1504
  type: "assistant.model.permission.required";
1466
1505
  data: {
package/src/events.js CHANGED
@@ -106,6 +106,14 @@ export const FusionContainerFailedV1 = {
106
106
  eventName: "fusion.container.failed",
107
107
  version: "1",
108
108
  };
109
+ export const FusionPreviewReadyV1 = {
110
+ eventName: "fusion.preview.ready",
111
+ version: "1",
112
+ };
113
+ export const FusionPreviewFailedV1 = {
114
+ eventName: "fusion.preview.failed",
115
+ version: "1",
116
+ };
109
117
  export const FusionBranchFailedV1 = {
110
118
  eventName: "fusion.branch.failed",
111
119
  version: "1",
package/src/index.d.ts CHANGED
@@ -23,5 +23,6 @@ export * from "./design-systems.js";
23
23
  export * from "./editor-ai.js";
24
24
  export * from "./realtime.js";
25
25
  export * from "./embeddings.js";
26
+ export * from "./system-one.js";
26
27
  export * from "./mcp-servers.js";
27
28
  export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
package/src/index.js CHANGED
@@ -23,5 +23,6 @@ export * from "./design-systems.js";
23
23
  export * from "./editor-ai.js";
24
24
  export * from "./realtime.js";
25
25
  export * from "./embeddings.js";
26
+ export * from "./system-one.js";
26
27
  export * from "./mcp-servers.js";
27
28
  export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";