@builder.io/ai-utils 0.74.4 → 0.75.1

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.74.4",
3
+ "version": "0.75.1",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
package/src/codegen.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import type { Options as PrettierOptions } from "prettier";
3
- import type { Attachment, ContentMessageItemToolResult } from "./messages";
3
+ import { type Attachment, type ContentMessageItemToolResult } from "./messages";
4
4
  import type { BuilderContent } from "./completion";
5
5
  import { type EnvironmentVariable, type SetupDependency } from "./common-schemas";
6
- import type { ForcedBackup, GitDiagnostics } from "./projects";
6
+ import type { ForcedBackup, GitDiagnostics, ProjectSkill } from "./projects";
7
7
  import type { Feature } from "./features";
8
8
  import type { CpuKind, BranchType } from "./projects";
9
9
  export declare const GitSnapshotSchema: z.ZodString;
@@ -3789,7 +3789,7 @@ export type MCPRegistrationSource = "local-configured" | "remote-registered" | "
3789
3789
  export interface MCPClientStatus {
3790
3790
  status: "ok" | "error" | "disabled" | "auth_required" | "auth_error" | "shadowed";
3791
3791
  message?: string;
3792
- protocol?: "streamable-http" | "sse" | "stdio";
3792
+ protocol: "streamable-http" | "sse" | "stdio" | undefined;
3793
3793
  connectionDurationMs: number;
3794
3794
  resolutionDurationMs: number;
3795
3795
  authorizationUrl?: string;
@@ -3823,7 +3823,7 @@ export interface MCPClientStatus {
3823
3823
  * group servers and gate per-source actions (e.g. server-managed MCPs
3824
3824
  * can't be reconnected from the CLI).
3825
3825
  */
3826
- source?: "local" | "plugin" | "builtin" | "server";
3826
+ source: "local" | "plugin" | "builtin" | "server" | undefined;
3827
3827
  /** Precedence scope from MCPServerDefinition (local/plugin only). */
3828
3828
  scope?: "project" | "user" | "plugin";
3829
3829
  /** Plugin that contributed this server, if any. */
@@ -3839,12 +3839,12 @@ export interface MCPClientStatus {
3839
3839
  url?: string;
3840
3840
  command?: string;
3841
3841
  /** Number of real (non-synthetic) tools currently exposed. */
3842
- toolCount?: number;
3842
+ toolCount: number | undefined;
3843
3843
  /** Lightweight tool catalog for the "View tools" sub-view. */
3844
- tools?: {
3844
+ tools: {
3845
3845
  name: string;
3846
3846
  description?: string;
3847
- }[];
3847
+ }[] | undefined;
3848
3848
  /** Capability flags reported by the server during initialize. */
3849
3849
  capabilities?: {
3850
3850
  tools?: boolean;
@@ -4109,6 +4109,11 @@ export interface FusionConfig {
4109
4109
  proxyOrigin?: string;
4110
4110
  proxyDefaultOrigin?: string;
4111
4111
  setupDependencies?: SetupDependency[];
4112
+ /**
4113
+ * Project-level skills to install during initialization.
4114
+ * Each skill is resolved to a `skills add` source and installed before setup runs.
4115
+ */
4116
+ skills?: ProjectSkill[];
4112
4117
  projectId?: string;
4113
4118
  /** Human-readable project name (e.g. "My App") */
4114
4119
  projectName?: string;
package/src/codegen.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { AttachmentSchema, ContentMessageItemToolResultSchema, } from "./messages";
3
- import { UserContextSchema } from "./mapping";
4
3
  import { EnvironmentVariableSchema, SetupDependencySchema, } from "./common-schemas";
4
+ import { UserContextSchema } from "./mapping";
5
5
  export const GitSnapshotSchema = z.string().meta({
6
6
  title: "GitSnapshot",
7
7
  description: "Multi-repo git snapshot. Format: 'folder:hash,folder:hash' " +
package/src/projects.d.ts CHANGED
@@ -330,6 +330,51 @@ export type ShutdownResponse = {
330
330
  export type ShutdownResponseSerialized = Omit<ShutdownResponse, "error"> & {
331
331
  error?: string;
332
332
  };
333
+ interface ProjectSkillBase {
334
+ /** Stable identifier for the entry (used for logs/dedup, not by the CLI). */
335
+ key: string;
336
+ /** Specific skill names to install (--skill). Omit to install all. */
337
+ skills?: string[];
338
+ /** Target agents (--agent). Defaults to ["claude-code"]. */
339
+ agents?: string[];
340
+ }
341
+ /**
342
+ * A skill source passed directly to `skills add`.
343
+ * Supports GitHub shorthand, Git/GitHub URLs, local paths, npm: sources, etc.
344
+ */
345
+ export interface ProjectSkillSource extends ProjectSkillBase {
346
+ source: string;
347
+ }
348
+ /**
349
+ * A skill sourced from an npm package.
350
+ * The package must contain a SKILL.md at its root (or a skills/<name>/SKILL.md).
351
+ */
352
+ export interface ProjectSkillNpm extends ProjectSkillBase {
353
+ type: "npm";
354
+ package: string;
355
+ version?: string;
356
+ }
357
+ /**
358
+ * A skill sourced from a GitHub repository that follows the Claude Code plugin layout
359
+ * (skills/<name>/SKILL.md) or contains a SKILL.md at root.
360
+ * ref can be a branch, tag, or commit SHA.
361
+ */
362
+ export interface ProjectSkillGithub extends ProjectSkillBase {
363
+ type: "github";
364
+ repo: string;
365
+ ref?: string;
366
+ /** Sub-path inside the repo to treat as the plugin root (default: repo root) */
367
+ path?: string;
368
+ }
369
+ /**
370
+ * A skill sourced from a URL supported by `skills add`, such as a GitHub/GitLab
371
+ * tree URL, a direct git URL, or a well-known skills index URL.
372
+ */
373
+ export interface ProjectSkillUrl extends ProjectSkillBase {
374
+ type: "url";
375
+ url: string;
376
+ }
377
+ export type ProjectSkill = ProjectSkillSource | ProjectSkillNpm | ProjectSkillGithub | ProjectSkillUrl;
333
378
  export type FusionExecutionEnvironment = "containerized" | "container-less" | "cloud" | "cloud-v2";
334
379
  export type AgentType = "setup-project" | "project-configuration" | "org-agent" | "code-review-orchestrator" | "design-system-indexer" | "builder-publish-integration";
335
380
  export interface PartialBranchData {
@@ -671,7 +716,8 @@ export interface Project {
671
716
  gitBranchNamingStrategy?: "ai-session" | "branch-name" | "custom";
672
717
  /** @internal Mise tools and custom scripts run before the setup command. Managed via builder.config.json. */
673
718
  setupDependencies?: SetupDependency[];
674
- /** Custom branch name pattern used when gitBranchNamingStrategy is "custom". */
719
+ /** Project-level skills to install during Fusion initialization. */
720
+ skills?: ProjectSkill[];
675
721
  gitBranchNamingCustom?: string;
676
722
  /** When true, the user is prompted to provide a branch name before a new branch is created. */
677
723
  askUserForBranchName?: boolean;
@@ -1301,6 +1347,12 @@ export declare const DeployStatusSchema: z.ZodEnum<{
1301
1347
  export type DeployStatus = z.infer<typeof DeployStatusSchema>;
1302
1348
  /** Deploy statuses that are terminal — never transitioned out of. */
1303
1349
  export declare const TERMINAL_DEPLOY_STATUSES: Set<"building" | "canceled" | "deploying" | "failed" | "live" | "queued" | "uploading">;
1350
+ export declare const HostingPublishStatusSchema: z.ZodEnum<{
1351
+ published: "published";
1352
+ publishing: "publishing";
1353
+ unpublished: "unpublished";
1354
+ }>;
1355
+ export type HostingPublishStatus = z.infer<typeof HostingPublishStatusSchema>;
1304
1356
  export declare const ProjectHostingBuildConfigSchema: z.ZodObject<{
1305
1357
  buildCommand: z.ZodOptional<z.ZodString>;
1306
1358
  buildOutputDir: z.ZodOptional<z.ZodString>;
@@ -1337,6 +1389,11 @@ export declare const ProjectHostingSchema: z.ZodObject<{
1337
1389
  explanation: z.ZodOptional<z.ZodString>;
1338
1390
  }, z.core.$strip>>>;
1339
1391
  }, z.core.$strip>>;
1392
+ publishStatus: z.ZodOptional<z.ZodEnum<{
1393
+ published: "published";
1394
+ publishing: "publishing";
1395
+ unpublished: "unpublished";
1396
+ }>>;
1340
1397
  lastDeployId: z.ZodOptional<z.ZodString>;
1341
1398
  lastDeployAt: z.ZodOptional<z.ZodNumber>;
1342
1399
  lastDeployStatus: z.ZodOptional<z.ZodEnum<{
@@ -1389,8 +1446,8 @@ export type Deploy = z.infer<typeof DeploySchema>;
1389
1446
  *
1390
1447
  * "Is this URL currently live?" is NOT a property of this doc. It's answered by the
1391
1448
  * presence of the per-slug `HTTPRoute` in Envoy Gateway (the source of truth for routing)
1392
- * and/or by `project.hosting.netlifySiteId` (set on publish, cleared on unpublish). The
1393
- * slug doc exists purely to enforce uniqueness and own the permanent reservation.
1449
+ * which is proxied by `project.hosting.publishStatus`.
1450
+ * The slug doc exists purely to enforce uniqueness and own the permanent reservation.
1394
1451
  */
1395
1452
  export declare const HostingSlugSchema: z.ZodObject<{
1396
1453
  projectId: z.ZodString;
@@ -1516,6 +1573,14 @@ export declare const DeployResponseSchema: z.ZodObject<{
1516
1573
  }>;
1517
1574
  }, z.core.$strip>;
1518
1575
  export type DeployResponse = z.infer<typeof DeployResponseSchema>;
1576
+ export declare const DeleteHostingRequestSchema: z.ZodObject<{
1577
+ projectId: z.ZodString;
1578
+ }, z.core.$strip>;
1579
+ export type DeleteHostingRequest = z.infer<typeof DeleteHostingRequestSchema>;
1580
+ export declare const DeleteHostingResponseSchema: z.ZodObject<{
1581
+ success: z.ZodLiteral<true>;
1582
+ }, z.core.$strip>;
1583
+ export type DeleteHostingResponse = z.infer<typeof DeleteHostingResponseSchema>;
1519
1584
  export declare const GetDeploysRequestSchema: z.ZodObject<{
1520
1585
  projectId: z.ZodString;
1521
1586
  deployId: z.ZodOptional<z.ZodString>;
package/src/projects.js CHANGED
@@ -206,6 +206,11 @@ export const TERMINAL_DEPLOY_STATUSES = new Set([
206
206
  "failed",
207
207
  "canceled",
208
208
  ]);
209
+ export const HostingPublishStatusSchema = z.enum([
210
+ "unpublished",
211
+ "publishing",
212
+ "published",
213
+ ]);
209
214
  export const ProjectHostingBuildConfigSchema = z.object({
210
215
  buildCommand: z.string().optional(),
211
216
  buildOutputDir: z.string().optional(),
@@ -222,10 +227,10 @@ export const ProjectHostingSchema = z.object({
222
227
  description: 'e.g. "my-cool-app" — set once on first publish, immutable',
223
228
  }),
224
229
  netlifySiteId: z.string().optional().meta({
225
- description: "Netlify site ID for management API calls; cleared on unpublish, set again on re-publish",
230
+ description: "Netlify site ID for management API calls. Set once on first publish, immutable.",
226
231
  }),
227
232
  netlifySiteName: z.string().optional().meta({
228
- description: "<name> in <name>.netlify.app — the upstream the HTTPRoute filter rewrites Host to; cleared on unpublish",
233
+ description: "<name> in <name>.netlify.app — the upstream the HTTPRoute filter rewrites Host to. Set once on first publish, immutable.",
229
234
  }),
230
235
  url: z.string().optional().meta({
231
236
  description: '"https://my-cool-app.builder.cloud" — derived from slug',
@@ -250,6 +255,9 @@ export const ProjectHostingSchema = z.object({
250
255
  }),
251
256
  })
252
257
  .optional(),
258
+ publishStatus: HostingPublishStatusSchema.optional().meta({
259
+ description: "Outer publish lifecycle. Absent === unpublished. Denormalized cache of the per-slug HTTPRoute (the source of truth); flipped only after the route op succeeds. Deploy.status is the interior detail of the publishing step.",
260
+ }),
253
261
  lastDeployId: z.string().optional(),
254
262
  lastDeployAt: z.number().optional(),
255
263
  lastDeployStatus: DeployStatusSchema.optional(),
@@ -304,8 +312,8 @@ export const DeploySchema = z.object({
304
312
  *
305
313
  * "Is this URL currently live?" is NOT a property of this doc. It's answered by the
306
314
  * presence of the per-slug `HTTPRoute` in Envoy Gateway (the source of truth for routing)
307
- * and/or by `project.hosting.netlifySiteId` (set on publish, cleared on unpublish). The
308
- * slug doc exists purely to enforce uniqueness and own the permanent reservation.
315
+ * which is proxied by `project.hosting.publishStatus`.
316
+ * The slug doc exists purely to enforce uniqueness and own the permanent reservation.
309
317
  */
310
318
  export const HostingSlugSchema = z.object({
311
319
  projectId: z.string(),
@@ -486,6 +494,12 @@ export const DeployResponseSchema = z.object({
486
494
  deployId: z.string(),
487
495
  status: DeployStatusSchema,
488
496
  });
497
+ export const DeleteHostingRequestSchema = z.object({
498
+ projectId: z.string(),
499
+ });
500
+ export const DeleteHostingResponseSchema = z.object({
501
+ success: z.literal(true),
502
+ });
489
503
  export const GetDeploysRequestSchema = z.object({
490
504
  projectId: z.string(),
491
505
  deployId: z.string().optional(),