siteplane 0.1.60 → 0.1.62

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/dist/next.js CHANGED
@@ -2098,8 +2098,95 @@ var editorColorSchemes = editorColorSchemeSchema.options;
2098
2098
  var editorColorModeSchema = z20.enum(["light", "dark"]);
2099
2099
  var editorColorModes = editorColorModeSchema.options;
2100
2100
 
2101
- // ../shared/dist/site-slug.js
2101
+ // ../shared/dist/editor-organization.js
2102
2102
  import { z as z21 } from "zod";
2103
+ var labelSchema = z21.string().trim().min(1).max(120);
2104
+ var updateFieldSchema = z21.object({
2105
+ operation: z21.literal("update_field"),
2106
+ siteId: z21.string().uuid(),
2107
+ fieldId: fieldIdSchema,
2108
+ label: labelSchema.optional(),
2109
+ description: z21.string().trim().max(500).nullable().optional(),
2110
+ section: labelSchema.nullable().optional(),
2111
+ subsection: labelSchema.nullable().optional(),
2112
+ sortOrder: z21.number().int().nonnegative().optional(),
2113
+ status: z21.enum(["hidden", "active"]).optional()
2114
+ });
2115
+ var updateEditorOrganizationInputSchema = z21.discriminatedUnion("operation", [
2116
+ updateFieldSchema,
2117
+ z21.object({
2118
+ operation: z21.literal("rename_section"),
2119
+ siteId: z21.string().uuid(),
2120
+ routeKey: siteFieldRouteKeySchema,
2121
+ currentSection: labelSchema,
2122
+ nextSection: labelSchema
2123
+ }),
2124
+ z21.object({
2125
+ operation: z21.literal("create_group"),
2126
+ siteId: z21.string().uuid(),
2127
+ routeKey: siteFieldRouteKeySchema,
2128
+ section: labelSchema,
2129
+ fieldIds: z21.array(fieldIdSchema).max(200).default([])
2130
+ }),
2131
+ z21.object({
2132
+ operation: z21.literal("delete_section"),
2133
+ siteId: z21.string().uuid(),
2134
+ routeKey: siteFieldRouteKeySchema,
2135
+ section: labelSchema
2136
+ }),
2137
+ z21.object({
2138
+ operation: z21.literal("move_section"),
2139
+ siteId: z21.string().uuid(),
2140
+ routeKey: siteFieldRouteKeySchema,
2141
+ section: labelSchema,
2142
+ direction: z21.enum(["up", "down"])
2143
+ }),
2144
+ z21.object({
2145
+ operation: z21.literal("create_subgroup"),
2146
+ siteId: z21.string().uuid(),
2147
+ routeKey: siteFieldRouteKeySchema,
2148
+ section: labelSchema,
2149
+ subsection: labelSchema,
2150
+ fieldIds: z21.array(fieldIdSchema).min(1).max(200)
2151
+ }),
2152
+ z21.object({
2153
+ operation: z21.literal("update_subgroup"),
2154
+ siteId: z21.string().uuid(),
2155
+ routeKey: siteFieldRouteKeySchema,
2156
+ currentSection: labelSchema,
2157
+ currentSubsection: labelSchema,
2158
+ section: labelSchema,
2159
+ subsection: labelSchema.nullable()
2160
+ }),
2161
+ z21.object({
2162
+ operation: z21.literal("rename_route"),
2163
+ siteId: z21.string().uuid(),
2164
+ routeKey: siteFieldRouteKeySchema.refine((value) => value !== "$global", "Global content has no page label."),
2165
+ label: labelSchema
2166
+ })
2167
+ ]).and(z21.object({
2168
+ review: z21.object({
2169
+ runId: z21.string().uuid(),
2170
+ expectedReviewVersion: z21.number().int().positive()
2171
+ }).strict().optional()
2172
+ })).superRefine((input, context) => {
2173
+ if (input.operation === "update_field" && input.label === void 0 && input.description === void 0 && input.section === void 0 && input.subsection === void 0 && input.sortOrder === void 0 && input.status === void 0) {
2174
+ context.addIssue({
2175
+ code: "custom",
2176
+ message: "At least one field organization value is required."
2177
+ });
2178
+ }
2179
+ if (input.operation === "update_field" && input.section === null && typeof input.subsection === "string") {
2180
+ context.addIssue({
2181
+ code: "custom",
2182
+ message: "A subgroup requires a group.",
2183
+ path: ["subsection"]
2184
+ });
2185
+ }
2186
+ });
2187
+
2188
+ // ../shared/dist/site-slug.js
2189
+ import { z as z22 } from "zod";
2103
2190
  var SITE_SLUG_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
2104
2191
  var RESERVED_SITE_SLUGS = /* @__PURE__ */ new Set([
2105
2192
  "account",
@@ -2116,31 +2203,31 @@ var RESERVED_SITE_SLUGS = /* @__PURE__ */ new Set([
2116
2203
  "support",
2117
2204
  "workspace"
2118
2205
  ]);
2119
- var siteSlugSchema = z21.string().regex(SITE_SLUG_PATTERN, "Invalid site slug").refine((value) => !RESERVED_SITE_SLUGS.has(value), "Reserved site slug");
2206
+ var siteSlugSchema = z22.string().regex(SITE_SLUG_PATTERN, "Invalid site slug").refine((value) => !RESERVED_SITE_SLUGS.has(value), "Reserved site slug");
2120
2207
 
2121
2208
  // ../shared/dist/entitlements.js
2122
- import { z as z22 } from "zod";
2123
- var entitlementSnapshotSchema = z22.object({
2124
- planKey: z22.string().trim().min(1),
2125
- sitesLimit: z22.number().int().positive(),
2126
- siteMembersPerSiteLimit: z22.number().int().positive(),
2127
- customAdminDomainsEnabled: z22.boolean(),
2128
- agentMcpEnabled: z22.boolean(),
2129
- emailNotificationsEnabled: z22.boolean(),
2130
- analyticsEnabled: z22.boolean(),
2131
- analyticsSitesLimit: z22.number().int().min(0),
2132
- analyticsPortalPerformanceEnabled: z22.boolean(),
2133
- analyticsMonthlyReportsEnabled: z22.boolean(),
2134
- analyticsAiSummaryEnabled: z22.boolean(),
2135
- analyticsRawEventRetentionDays: z22.number().int().min(1).max(ANALYTICS_RETENTION_DEFAULTS.maxRawEventRetentionDaysWithoutAdr),
2136
- analyticsMonthlyEventLimit: z22.number().int().min(0),
2137
- bookingEnabled: z22.boolean().default(false),
2138
- bookingSitesLimit: z22.number().int().min(0).default(0),
2139
- bookingPortalManagementEnabled: z22.boolean().default(false),
2140
- bookingResourcesPerSiteLimit: z22.number().int().min(0).default(0),
2141
- bookingServicesPerSiteLimit: z22.number().int().min(0).default(0),
2142
- bookingMonthlyBookingsLimit: z22.number().int().min(0).default(0),
2143
- bookingRemindersEnabled: z22.boolean().default(false)
2209
+ import { z as z23 } from "zod";
2210
+ var entitlementSnapshotSchema = z23.object({
2211
+ planKey: z23.string().trim().min(1),
2212
+ sitesLimit: z23.number().int().positive(),
2213
+ siteMembersPerSiteLimit: z23.number().int().positive(),
2214
+ customAdminDomainsEnabled: z23.boolean(),
2215
+ agentMcpEnabled: z23.boolean(),
2216
+ emailNotificationsEnabled: z23.boolean(),
2217
+ analyticsEnabled: z23.boolean(),
2218
+ analyticsSitesLimit: z23.number().int().min(0),
2219
+ analyticsPortalPerformanceEnabled: z23.boolean(),
2220
+ analyticsMonthlyReportsEnabled: z23.boolean(),
2221
+ analyticsAiSummaryEnabled: z23.boolean(),
2222
+ analyticsRawEventRetentionDays: z23.number().int().min(1).max(ANALYTICS_RETENTION_DEFAULTS.maxRawEventRetentionDaysWithoutAdr),
2223
+ analyticsMonthlyEventLimit: z23.number().int().min(0),
2224
+ bookingEnabled: z23.boolean().default(false),
2225
+ bookingSitesLimit: z23.number().int().min(0).default(0),
2226
+ bookingPortalManagementEnabled: z23.boolean().default(false),
2227
+ bookingResourcesPerSiteLimit: z23.number().int().min(0).default(0),
2228
+ bookingServicesPerSiteLimit: z23.number().int().min(0).default(0),
2229
+ bookingMonthlyBookingsLimit: z23.number().int().min(0).default(0),
2230
+ bookingRemindersEnabled: z23.boolean().default(false)
2144
2231
  });
2145
2232
  var EARLY_ACCESS_PLAN = {
2146
2233
  planKey: "early_access_2026",
@@ -2169,7 +2256,7 @@ var EARLY_ACCESS_PLAN = {
2169
2256
  var maxFirstPartyImageUploadBytes = 4 * 1024 * 1024;
2170
2257
 
2171
2258
  // ../shared/dist/readiness.js
2172
- import { z as z23 } from "zod";
2259
+ import { z as z24 } from "zod";
2173
2260
  var READINESS_CHECK_KEYS = [
2174
2261
  "agent_instructions_installed",
2175
2262
  "runtime_package_connected",
@@ -2184,118 +2271,118 @@ var READINESS_STATUSES = [
2184
2271
  "failing",
2185
2272
  "warning"
2186
2273
  ];
2187
- var readinessCheckKeySchema = z23.enum(READINESS_CHECK_KEYS);
2188
- var readinessStatusSchema = z23.enum(READINESS_STATUSES);
2274
+ var readinessCheckKeySchema = z24.enum(READINESS_CHECK_KEYS);
2275
+ var readinessStatusSchema = z24.enum(READINESS_STATUSES);
2189
2276
 
2190
2277
  // ../shared/dist/site.js
2191
- import { z as z24 } from "zod";
2278
+ import { z as z25 } from "zod";
2192
2279
  var SITE_STATUSES = [
2193
2280
  "setup",
2194
2281
  "active",
2195
2282
  "disabled",
2196
2283
  "archived"
2197
2284
  ];
2198
- var siteStatusSchema = z24.enum(SITE_STATUSES);
2199
- var websiteUrlSchema = z24.string().trim().url().refine((value) => value.startsWith("https://") || value.startsWith("http://"), "Website URL must use http or https");
2285
+ var siteStatusSchema = z25.enum(SITE_STATUSES);
2286
+ var websiteUrlSchema = z25.string().trim().url().refine((value) => value.startsWith("https://") || value.startsWith("http://"), "Website URL must use http or https");
2200
2287
 
2201
2288
  // ../shared/dist/setup-assets.js
2202
- import { z as z25 } from "zod";
2203
- var configureSetupAssetTargetInputSchema = z25.object({
2204
- siteId: z25.string().uuid(),
2205
- runId: z25.string().uuid(),
2206
- expectedReviewVersion: z25.number().int().positive(),
2207
- expectedSnapshotHash: z25.string().regex(/^sha256:[0-9a-f]{64}$/u),
2208
- mutationId: z25.string().uuid(),
2209
- expectedApprovalId: z25.string().uuid().nullable(),
2210
- targetId: z25.string().uuid().nullable(),
2211
- targetType: z25.enum(["repo_static_assets", "siteplane_managed_fallback"]),
2212
- approveManagedHosting: z25.boolean()
2289
+ import { z as z26 } from "zod";
2290
+ var configureSetupAssetTargetInputSchema = z26.object({
2291
+ siteId: z26.string().uuid(),
2292
+ runId: z26.string().uuid(),
2293
+ expectedReviewVersion: z26.number().int().positive(),
2294
+ expectedSnapshotHash: z26.string().regex(/^sha256:[0-9a-f]{64}$/u),
2295
+ mutationId: z26.string().uuid(),
2296
+ expectedApprovalId: z26.string().uuid().nullable(),
2297
+ targetId: z26.string().uuid().nullable(),
2298
+ targetType: z26.enum(["repo_static_assets", "siteplane_managed_fallback"]),
2299
+ approveManagedHosting: z26.boolean()
2213
2300
  }).strict().refine((value) => value.targetType === "siteplane_managed_fallback" || !value.approveManagedHosting);
2214
- var setupAssetTargetApprovalSchema = z25.object({
2215
- id: z25.string().uuid(),
2216
- runId: z25.string().uuid(),
2217
- reviewVersion: z25.number().int().positive(),
2218
- snapshotHash: z25.string().regex(/^sha256:[0-9a-f]{64}$/u),
2219
- targetId: z25.string().uuid(),
2220
- targetType: z25.enum(["repo_static_assets", "siteplane_managed_fallback"]),
2221
- targetRevision: z25.number().int().positive(),
2222
- deploymentOrigin: z25.string().url(),
2223
- gitConnectionId: z25.string().uuid().nullable(),
2224
- gitRevision: z25.number().int().positive().nullable(),
2225
- managedHostingApproved: z25.boolean(),
2226
- actorUserId: z25.string().uuid(),
2227
- approvedAt: z25.string().datetime({ offset: true })
2301
+ var setupAssetTargetApprovalSchema = z26.object({
2302
+ id: z26.string().uuid(),
2303
+ runId: z26.string().uuid(),
2304
+ reviewVersion: z26.number().int().positive(),
2305
+ snapshotHash: z26.string().regex(/^sha256:[0-9a-f]{64}$/u),
2306
+ targetId: z26.string().uuid(),
2307
+ targetType: z26.enum(["repo_static_assets", "siteplane_managed_fallback"]),
2308
+ targetRevision: z26.number().int().positive(),
2309
+ deploymentOrigin: z26.string().url(),
2310
+ gitConnectionId: z26.string().uuid().nullable(),
2311
+ gitRevision: z26.number().int().positive().nullable(),
2312
+ managedHostingApproved: z26.boolean(),
2313
+ actorUserId: z26.string().uuid(),
2314
+ approvedAt: z26.string().datetime({ offset: true })
2228
2315
  }).strict();
2229
- var setupAssetReadinessSchema = z25.union([
2230
- z25.object({
2231
- status: z25.enum([
2316
+ var setupAssetReadinessSchema = z26.union([
2317
+ z26.object({
2318
+ status: z26.enum([
2232
2319
  "not_required",
2233
2320
  "needs_choice",
2234
2321
  "stale_setup_review",
2235
2322
  "permission_denied"
2236
2323
  ])
2237
2324
  }).strict(),
2238
- z25.object({
2239
- status: z25.literal("stale_approval"),
2325
+ z26.object({
2326
+ status: z26.literal("stale_approval"),
2240
2327
  approval: setupAssetTargetApprovalSchema.optional()
2241
2328
  }).strict(),
2242
- z25.object({
2243
- status: z25.literal("not_verified"),
2329
+ z26.object({
2330
+ status: z26.literal("not_verified"),
2244
2331
  approval: setupAssetTargetApprovalSchema,
2245
- jobId: z25.string().uuid().optional(),
2246
- checkedAt: z25.string().datetime({ offset: true }).nullable().optional()
2332
+ jobId: z26.string().uuid().optional(),
2333
+ checkedAt: z26.string().datetime({ offset: true }).nullable().optional()
2247
2334
  }).strict(),
2248
- z25.object({
2249
- status: z25.enum(["ready", "checking", "retrying"]),
2335
+ z26.object({
2336
+ status: z26.enum(["ready", "checking", "retrying"]),
2250
2337
  approval: setupAssetTargetApprovalSchema,
2251
- jobId: z25.string().uuid(),
2252
- checkedAt: z25.string().datetime({ offset: true }).nullable()
2338
+ jobId: z26.string().uuid(),
2339
+ checkedAt: z26.string().datetime({ offset: true }).nullable()
2253
2340
  }).strict().refine((value) => value.status !== "ready" || value.checkedAt !== null)
2254
2341
  ]);
2255
- var checkSetupAssetTargetInputSchema = z25.object({
2256
- siteId: z25.string().uuid(),
2257
- runId: z25.string().uuid(),
2258
- approvalId: z25.string().uuid(),
2259
- intent: z25.enum(["start", "poll"])
2342
+ var checkSetupAssetTargetInputSchema = z26.object({
2343
+ siteId: z26.string().uuid(),
2344
+ runId: z26.string().uuid(),
2345
+ approvalId: z26.string().uuid(),
2346
+ intent: z26.enum(["start", "poll"])
2260
2347
  }).strict();
2261
2348
 
2262
2349
  // ../shared/dist/setup-installation.js
2263
- import { z as z26 } from "zod";
2264
- var setupInstallationRequestSchema = z26.object({
2350
+ import { z as z27 } from "zod";
2351
+ var setupInstallationRequestSchema = z27.object({
2265
2352
  modules: siteSetupModulesSchema,
2266
2353
  ownerEditabilityNote: siteSetupOwnerEditabilityNoteSchema,
2267
- provider: z26.object({
2268
- projectId: z26.string().min(1).max(200),
2269
- teamId: z26.string().min(1).max(200)
2354
+ provider: z27.object({
2355
+ projectId: z27.string().min(1).max(200),
2356
+ teamId: z27.string().min(1).max(200)
2270
2357
  }).strict()
2271
2358
  }).strict();
2272
2359
 
2273
2360
  // ../shared/dist/setup-claim.js
2274
- import { z as z27 } from "zod";
2275
- var setupClaimCodeSchema = z27.string().regex(/^[0-9A-HJKMNP-TV-Z]{8}$/u);
2276
- var setupClaimBindingSchema = z27.object({
2277
- siteId: z27.string().uuid(),
2278
- runId: z27.string().uuid()
2361
+ import { z as z28 } from "zod";
2362
+ var setupClaimCodeSchema = z28.string().regex(/^[0-9A-HJKMNP-TV-Z]{8}$/u);
2363
+ var setupClaimBindingSchema = z28.object({
2364
+ siteId: z28.string().uuid(),
2365
+ runId: z28.string().uuid()
2279
2366
  });
2280
2367
  var setupClaimReceiptSchema = setupClaimBindingSchema.extend({
2281
- status: z27.literal("claimed"),
2282
- requestId: z27.string().uuid(),
2283
- workspaceId: z27.string().uuid(),
2284
- userId: z27.string().uuid(),
2285
- claimedAt: z27.string().datetime({ offset: true })
2368
+ status: z28.literal("claimed"),
2369
+ requestId: z28.string().uuid(),
2370
+ workspaceId: z28.string().uuid(),
2371
+ userId: z28.string().uuid(),
2372
+ claimedAt: z28.string().datetime({ offset: true })
2286
2373
  }).strict();
2287
2374
  var setupClaimInspectionSchema = setupClaimBindingSchema.extend({
2288
- status: z27.literal("pending"),
2289
- requestId: z27.string().uuid(),
2290
- siteName: z27.string(),
2291
- userId: z27.string().uuid(),
2292
- accountEmail: z27.string().email(),
2293
- workspaceId: z27.string().uuid(),
2294
- workspaceName: z27.string(),
2295
- expiresAt: z27.string().datetime({ offset: true })
2375
+ status: z28.literal("pending"),
2376
+ requestId: z28.string().uuid(),
2377
+ siteName: z28.string(),
2378
+ userId: z28.string().uuid(),
2379
+ accountEmail: z28.string().email(),
2380
+ workspaceId: z28.string().uuid(),
2381
+ workspaceName: z28.string(),
2382
+ expiresAt: z28.string().datetime({ offset: true })
2296
2383
  }).strict();
2297
- var setupClaimDenialSchema = z27.object({
2298
- status: z27.enum([
2384
+ var setupClaimDenialSchema = z28.object({
2385
+ status: z28.enum([
2299
2386
  "invalid_claim_request",
2300
2387
  "invalid_installation",
2301
2388
  "already_claimed",
@@ -2363,16 +2450,16 @@ function createAnalyticsCliRequestHeaders(config) {
2363
2450
  }
2364
2451
 
2365
2452
  // ../cli/dist/commands/analytics/public-key.js
2366
- import { z as z28 } from "zod";
2367
- var responseSchema = z28.object({
2368
- ok: z28.literal(true),
2369
- data: z28.object({
2370
- rawPublicKey: z28.string().regex(/^pk_siteplane_[A-Za-z0-9_-]{16}_[A-Za-z0-9_-]{43}$/)
2453
+ import { z as z29 } from "zod";
2454
+ var responseSchema = z29.object({
2455
+ ok: z29.literal(true),
2456
+ data: z29.object({
2457
+ rawPublicKey: z29.string().regex(/^pk_siteplane_[A-Za-z0-9_-]{16}_[A-Za-z0-9_-]{43}$/)
2371
2458
  })
2372
2459
  });
2373
- var errorResponseSchema = z28.object({
2374
- error: z28.object({
2375
- code: z28.string().regex(/^[a-z][a-z0-9_.-]+$/u)
2460
+ var errorResponseSchema = z29.object({
2461
+ error: z29.object({
2462
+ code: z29.string().regex(/^[a-z][a-z0-9_.-]+$/u)
2376
2463
  })
2377
2464
  });
2378
2465
  async function analyticsPublicKeyCommand(input) {
@@ -2394,13 +2481,13 @@ async function analyticsPublicKeyCommand(input) {
2394
2481
  }
2395
2482
 
2396
2483
  // ../cli/dist/commands/analytics/prepare.js
2397
- import { z as z29 } from "zod";
2398
- var resultSchema = z29.object({
2399
- ok: z29.literal(true),
2400
- data: z29.object({
2401
- rawPublicKey: z29.string().regex(/^pk_siteplane_[A-Za-z0-9_-]{16}_[A-Za-z0-9_-]{43}$/u),
2402
- generation: z29.number().int().positive(),
2403
- status: z29.enum([
2484
+ import { z as z30 } from "zod";
2485
+ var resultSchema = z30.object({
2486
+ ok: z30.literal(true),
2487
+ data: z30.object({
2488
+ rawPublicKey: z30.string().regex(/^pk_siteplane_[A-Za-z0-9_-]{16}_[A-Za-z0-9_-]{43}$/u),
2489
+ generation: z30.number().int().positive(),
2490
+ status: z30.enum([
2404
2491
  "setup_started",
2405
2492
  "test_mode",
2406
2493
  "active",
@@ -2410,8 +2497,8 @@ var resultSchema = z29.object({
2410
2497
  ])
2411
2498
  }).strict()
2412
2499
  }).strict();
2413
- var errorSchema = z29.object({
2414
- error: z29.object({ code: z29.string().regex(/^[a-z][a-z0-9_.-]+$/u) })
2500
+ var errorSchema = z30.object({
2501
+ error: z30.object({ code: z30.string().regex(/^[a-z][a-z0-9_.-]+$/u) })
2415
2502
  });
2416
2503
 
2417
2504
  // ../cli/dist/commands/analytics/test.js
@@ -2444,19 +2531,19 @@ ${bookingRulesTemplate}`;
2444
2531
  import { access, chmod, open, readFile as readFile5, rename, rm } from "fs/promises";
2445
2532
  import { randomUUID as randomUUID2 } from "crypto";
2446
2533
  import { join as join3 } from "path";
2447
- import { z as z30 } from "zod";
2448
- var siteplaneProjectConfigSchema = z30.object({
2449
- version: z30.literal(2),
2450
- apiBaseUrl: z30.string().url(),
2451
- siteId: z30.string().uuid(),
2452
- publicSiteKeyId: z30.string().uuid(),
2453
- publicSiteKey: z30.string().trim().min(1),
2454
- runId: z30.string().uuid(),
2455
- appDirectory: z30.string().min(1),
2456
- taskContractVersion: z30.literal("siteplane.setup-task.v2"),
2457
- adminProtocolVersion: z30.literal(2),
2534
+ import { z as z31 } from "zod";
2535
+ var siteplaneProjectConfigSchema = z31.object({
2536
+ version: z31.literal(2),
2537
+ apiBaseUrl: z31.string().url(),
2538
+ siteId: z31.string().uuid(),
2539
+ publicSiteKeyId: z31.string().uuid(),
2540
+ publicSiteKey: z31.string().trim().min(1),
2541
+ runId: z31.string().uuid(),
2542
+ appDirectory: z31.string().min(1),
2543
+ taskContractVersion: z31.literal("siteplane.setup-task.v2"),
2544
+ adminProtocolVersion: z31.literal(2),
2458
2545
  packages: siteSetupPackagesSchema,
2459
- fieldContractHash: z30.string().regex(/^sha256:[0-9a-f]{64}$/iu).optional()
2546
+ fieldContractHash: z31.string().regex(/^sha256:[0-9a-f]{64}$/iu).optional()
2460
2547
  }).strict();
2461
2548
  async function readProjectConfig(projectDir) {
2462
2549
  return siteplaneProjectConfigSchema.parse(JSON.parse(await readFile5(join3(projectDir, "siteplane.config.json"), "utf8")));
@@ -2468,27 +2555,27 @@ import { randomUUID as randomUUID3 } from "crypto";
2468
2555
  import { chmod as chmod2, lstat, mkdir as mkdir5, open as open2, readFile as readFile6, rename as rename2, rm as rm2 } from "fs/promises";
2469
2556
  import { dirname as dirname5, join as join4, relative } from "path";
2470
2557
  import { promisify } from "util";
2471
- import { z as z31 } from "zod";
2472
- var localSetupInstallationSchema = z31.object({
2473
- key: z31.string().regex(/^[A-Za-z0-9_-]{43}$/u),
2474
- idempotencyKey: z31.string().uuid(),
2475
- apiBaseUrl: z31.string().url(),
2558
+ import { z as z32 } from "zod";
2559
+ var localSetupInstallationSchema = z32.object({
2560
+ key: z32.string().regex(/^[A-Za-z0-9_-]{43}$/u),
2561
+ idempotencyKey: z32.string().uuid(),
2562
+ apiBaseUrl: z32.string().url(),
2476
2563
  request: setupInstallationRequestSchema,
2477
- bootstrapAcknowledged: z31.boolean()
2564
+ bootstrapAcknowledged: z32.boolean()
2478
2565
  }).strict();
2479
- var siteplaneCredentialsSchema = z31.object({
2480
- accessToken: z31.string().trim().min(1),
2481
- siteRevalidationSecret: z31.string().trim().min(1),
2566
+ var siteplaneCredentialsSchema = z32.object({
2567
+ accessToken: z32.string().trim().min(1),
2568
+ siteRevalidationSecret: z32.string().trim().min(1),
2482
2569
  installation: localSetupInstallationSchema.optional(),
2483
2570
  claimReceipt: setupClaimReceiptSchema.optional(),
2484
- adminSession: z31.object({
2485
- secret: z31.string().regex(/^[A-Za-z0-9_-]{43}$/u),
2486
- generation: z31.string().uuid()
2571
+ adminSession: z32.object({
2572
+ secret: z32.string().regex(/^[A-Za-z0-9_-]{43}$/u),
2573
+ generation: z32.string().uuid()
2487
2574
  }).strict().optional()
2488
2575
  }).strict();
2489
- var localSetupCredentialsSchema = z31.union([
2576
+ var localSetupCredentialsSchema = z32.union([
2490
2577
  siteplaneCredentialsSchema,
2491
- z31.object({ installation: localSetupInstallationSchema }).strict()
2578
+ z32.object({ installation: localSetupInstallationSchema }).strict()
2492
2579
  ]);
2493
2580
  async function assertLocalCredentialsPathSafe(projectDir, options = {}) {
2494
2581
  const path = join4(projectDir, ".siteplane/credentials.json");
@@ -2549,7 +2636,7 @@ async function gitPathMatches(projectDir, path, command) {
2549
2636
  // ../cli/dist/commands/init.js
2550
2637
  import { access as access3 } from "fs/promises";
2551
2638
  import { join as join7, relative as relative3 } from "path";
2552
- import { z as z34 } from "zod";
2639
+ import { z as z35 } from "zod";
2553
2640
 
2554
2641
  // ../cli/dist/commands/setup-preflight.js
2555
2642
  import { createHash as createHash2 } from "crypto";
@@ -2561,11 +2648,11 @@ import { parse as parseYaml } from "yaml";
2561
2648
  import { createRequire } from "module";
2562
2649
  import { readFile as readFile7 } from "fs/promises";
2563
2650
  import { join as join5 } from "path";
2564
- import { z as z32 } from "zod";
2565
- var packageSchema = z32.object({
2566
- name: z32.string().optional(),
2567
- version: z32.string(),
2568
- peerDependencies: z32.record(z32.string(), z32.string()).optional()
2651
+ import { z as z33 } from "zod";
2652
+ var packageSchema = z33.object({
2653
+ name: z33.string().optional(),
2654
+ version: z33.string(),
2655
+ peerDependencies: z33.record(z33.string(), z33.string()).optional()
2569
2656
  });
2570
2657
  async function readInstalledPackage(projectDir, name2) {
2571
2658
  const require2 = createRequire(join5(projectDir, "package.json"));
@@ -2583,7 +2670,7 @@ async function readInstalledPackage(projectDir, name2) {
2583
2670
  // ../cli/dist/commands/setup-preflight.js
2584
2671
  import { access as access2, readFile as readFile8, realpath, readdir, readlink } from "fs/promises";
2585
2672
  import { dirname as dirname6, join as join6, relative as relative2, resolve, sep } from "path";
2586
- import { z as z33 } from "zod";
2673
+ import { z as z34 } from "zod";
2587
2674
 
2588
2675
  // ../cli/dist/commands/setup-process.js
2589
2676
  import { spawn } from "child_process";
@@ -2684,29 +2771,29 @@ async function setupVercelApi(cwd, endpoint, body, method, options) {
2684
2771
  }
2685
2772
 
2686
2773
  // ../cli/dist/commands/setup-preflight.js
2687
- var manifestSchema = z33.object({
2688
- packageManager: z33.string().optional(),
2689
- engines: z33.object({ node: z33.string().optional() }).optional(),
2690
- dependencies: z33.record(z33.string(), z33.string()).optional(),
2691
- devDependencies: z33.record(z33.string(), z33.string()).optional(),
2692
- scripts: z33.record(z33.string(), z33.string()).optional(),
2693
- workspaces: z33.unknown().optional()
2774
+ var manifestSchema = z34.object({
2775
+ packageManager: z34.string().optional(),
2776
+ engines: z34.object({ node: z34.string().optional() }).optional(),
2777
+ dependencies: z34.record(z34.string(), z34.string()).optional(),
2778
+ devDependencies: z34.record(z34.string(), z34.string()).optional(),
2779
+ scripts: z34.record(z34.string(), z34.string()).optional(),
2780
+ workspaces: z34.unknown().optional()
2694
2781
  });
2695
- var vercelProjectSchema = z33.object({
2696
- id: z33.string(),
2697
- accountId: z33.string(),
2698
- name: z33.string(),
2699
- nodeVersion: z33.string().nullable().optional(),
2700
- rootDirectory: z33.string().nullable().optional(),
2701
- framework: z33.string().nullable().optional(),
2702
- installCommand: z33.string().nullable().optional(),
2703
- buildCommand: z33.string().nullable().optional(),
2704
- link: z33.object({
2705
- type: z33.string(),
2706
- repo: z33.string().optional(),
2707
- repoId: z33.union([z33.string(), z33.number()]).optional(),
2708
- org: z33.string().optional(),
2709
- productionBranch: z33.string().optional()
2782
+ var vercelProjectSchema = z34.object({
2783
+ id: z34.string(),
2784
+ accountId: z34.string(),
2785
+ name: z34.string(),
2786
+ nodeVersion: z34.string().nullable().optional(),
2787
+ rootDirectory: z34.string().nullable().optional(),
2788
+ framework: z34.string().nullable().optional(),
2789
+ installCommand: z34.string().nullable().optional(),
2790
+ buildCommand: z34.string().nullable().optional(),
2791
+ link: z34.object({
2792
+ type: z34.string(),
2793
+ repo: z34.string().optional(),
2794
+ repoId: z34.union([z34.string(), z34.number()]).optional(),
2795
+ org: z34.string().optional(),
2796
+ productionBranch: z34.string().optional()
2710
2797
  }).nullable().optional()
2711
2798
  });
2712
2799
  var exists = async (path) => access2(path).then(() => true, () => false);
@@ -2763,9 +2850,9 @@ async function inspectSetupLocalProject(projectDir) {
2763
2850
  const rootManifest = manifestSchema.parse(JSON.parse(await readFile8(join6(lockfileRoot, "package.json"), "utf8")));
2764
2851
  if (lockfileRoot !== projectDirectory) {
2765
2852
  const workspaceFile = join6(lockfileRoot, "pnpm-workspace.yaml");
2766
- const workspace = lockName === "pnpm-lock.yaml" && await exists(workspaceFile) ? z33.object({ packages: z33.array(z33.string()) }).parse(parseYaml(await readFile8(workspaceFile, "utf8"))).packages : z33.union([
2767
- z33.array(z33.string()),
2768
- z33.object({ packages: z33.array(z33.string()) }).transform((value) => value.packages)
2853
+ const workspace = lockName === "pnpm-lock.yaml" && await exists(workspaceFile) ? z34.object({ packages: z34.array(z34.string()) }).parse(parseYaml(await readFile8(workspaceFile, "utf8"))).packages : z34.union([
2854
+ z34.array(z34.string()),
2855
+ z34.object({ packages: z34.array(z34.string()) }).transform((value) => value.packages)
2769
2856
  ]).parse(rootManifest.workspaces);
2770
2857
  const selected = relative2(lockfileRoot, projectDirectory).split(sep).join("/");
2771
2858
  if (!workspace.some((pattern) => !pattern.startsWith("!") && minimatch(selected, pattern)) || workspace.some((pattern) => pattern.startsWith("!") && minimatch(selected, pattern.slice(1))))
@@ -2779,11 +2866,11 @@ async function inspectSetupLocalProject(projectDir) {
2779
2866
  break;
2780
2867
  }
2781
2868
  const lockText = await readFile8(join6(lockfileRoot, lockName), "utf8");
2782
- const npmLock = lockName === "package-lock.json" ? z33.object({
2783
- lockfileVersion: z33.number(),
2784
- packages: z33.record(z33.string(), z33.object({
2785
- version: z33.string().optional(),
2786
- peerDependencies: z33.record(z33.string(), z33.string()).optional()
2869
+ const npmLock = lockName === "package-lock.json" ? z34.object({
2870
+ lockfileVersion: z34.number(),
2871
+ packages: z34.record(z34.string(), z34.object({
2872
+ version: z34.string().optional(),
2873
+ peerDependencies: z34.record(z34.string(), z34.string()).optional()
2787
2874
  })).optional()
2788
2875
  }).parse(JSON.parse(lockText)) : null;
2789
2876
  async function version2(name3) {
@@ -2921,9 +3008,9 @@ async function setupPreflightCommand(input) {
2921
3008
  linkDirectory = dirname6(linkDirectory);
2922
3009
  if (!await exists(join6(linkDirectory, ".vercel/project.json")))
2923
3010
  fail("vercel_project_not_linked", "Link this application to its intended Vercel project before setup; Siteplane will not guess a target.");
2924
- const linked = z33.object({
2925
- projectId: z33.string().regex(/^prj_[A-Za-z0-9]+$/u),
2926
- orgId: z33.string().regex(/^(?:team|user)_[A-Za-z0-9]+$/u)
3011
+ const linked = z34.object({
3012
+ projectId: z34.string().regex(/^prj_[A-Za-z0-9]+$/u),
3013
+ orgId: z34.string().regex(/^(?:team|user)_[A-Za-z0-9]+$/u)
2927
3014
  }).parse(JSON.parse(await readFile8(join6(linkDirectory, ".vercel/project.json"), "utf8")));
2928
3015
  const project = vercelProjectSchema.parse(await setupVercelApi(linkDirectory, `/v9/projects/${linked.projectId}?teamId=${linked.orgId}`));
2929
3016
  if (project.id !== linked.projectId || project.accountId !== linked.orgId)
@@ -2937,11 +3024,11 @@ async function setupPreflightCommand(input) {
2937
3024
  fail("vercel_production_branch_conflict", "The local branch differs from the bound Vercel Production branch.");
2938
3025
  if (project.link?.repo && project.link.org && !local.git.remote?.replace(/\.git$/u, "").endsWith(`${project.link.org}/${project.link.repo}`))
2939
3026
  fail("vercel_git_conflict", "The local origin repository differs from the Vercel Git connection.");
2940
- const env = z33.object({
2941
- envs: z33.array(z33.object({
2942
- key: z33.string(),
2943
- value: z33.string().optional(),
2944
- target: z33.array(z33.string()).optional()
3027
+ const env = z34.object({
3028
+ envs: z34.array(z34.object({
3029
+ key: z34.string(),
3030
+ value: z34.string().optional(),
3031
+ target: z34.array(z34.string()).optional()
2945
3032
  }))
2946
3033
  }).parse(await setupVercelApi(linkDirectory, `/v10/projects/${linked.projectId}/env?teamId=${linked.orgId}`));
2947
3034
  const corepack = env.envs.some((item) => item.key === "ENABLE_EXPERIMENTAL_COREPACK" && item.value === "1" && item.target?.includes("production"));
@@ -2959,6 +3046,11 @@ async function setupPreflightCommand(input) {
2959
3046
  fail("vercel_package_manager_conflict", "The provider install command conflicts with the canonical lockfile.");
2960
3047
  if (overridePin && local.packageManager.declared && `${overridePin[1]}@${overridePin[2]}` !== local.packageManager.declared)
2961
3048
  fail("vercel_package_manager_conflict", "The Vercel install override conflicts with the exact packageManager declaration.");
3049
+ const build = project.buildCommand;
3050
+ const buildPin = build ? /\b(npm|pnpm|yarn|bun)@(\d+\.\d+\.\d+)\b/u.exec(build) : null;
3051
+ const buildFamily = buildPin?.[1] ?? (build ? /(?:^|[;&|]\s*)(npm|pnpm|yarn|bun)\s+(?:run\s+)?build\b/u.exec(build)?.[1] : null);
3052
+ if (buildFamily && (buildFamily !== local.packageManager.name || buildPin && local.packageManager.declared && `${buildPin[1]}@${buildPin[2]}` !== local.packageManager.declared))
3053
+ fail("vercel_package_manager_conflict", "The explicit Vercel build command conflicts with the selected package manager or its declared version. Align the existing build override and rerun preflight; no setup writes were performed.");
2962
3054
  return {
2963
3055
  status: "ready",
2964
3056
  local,
@@ -3003,26 +3095,26 @@ function safeGitRemote(value) {
3003
3095
  }
3004
3096
 
3005
3097
  // ../cli/dist/commands/init.js
3006
- var siteSetupBootstrapDataSchema = z34.object({
3007
- credentialPurpose: z34.literal("site_setup"),
3008
- apiBaseUrl: z34.string().url(),
3009
- siteId: z34.string().uuid(),
3010
- publicSiteKeyId: z34.string().uuid(),
3011
- publicSiteKey: z34.string().trim().min(1),
3012
- accessToken: z34.string().trim().min(1),
3013
- siteRevalidationSecret: z34.string().regex(/^[A-Za-z0-9_-]{43}$/u),
3014
- runId: z34.string().uuid(),
3098
+ var siteSetupBootstrapDataSchema = z35.object({
3099
+ credentialPurpose: z35.literal("site_setup"),
3100
+ apiBaseUrl: z35.string().url(),
3101
+ siteId: z35.string().uuid(),
3102
+ publicSiteKeyId: z35.string().uuid(),
3103
+ publicSiteKey: z35.string().trim().min(1),
3104
+ accessToken: z35.string().trim().min(1),
3105
+ siteRevalidationSecret: z35.string().regex(/^[A-Za-z0-9_-]{43}$/u),
3106
+ runId: z35.string().uuid(),
3015
3107
  packages: siteSetupPackagesSchema
3016
3108
  }).strict();
3017
- var featureBootstrapDataSchema = z34.object({
3018
- credentialPurpose: z34.enum(["analytics", "booking"]),
3019
- apiBaseUrl: z34.string().url(),
3020
- siteId: z34.string().uuid(),
3021
- accessToken: z34.string().trim().min(1)
3109
+ var featureBootstrapDataSchema = z35.object({
3110
+ credentialPurpose: z35.enum(["analytics", "booking"]),
3111
+ apiBaseUrl: z35.string().url(),
3112
+ siteId: z35.string().uuid(),
3113
+ accessToken: z35.string().trim().min(1)
3022
3114
  }).strict();
3023
- var bootstrapResponseSchema = z34.object({
3024
- ok: z34.literal(true),
3025
- data: z34.discriminatedUnion("credentialPurpose", [
3115
+ var bootstrapResponseSchema = z35.object({
3116
+ ok: z35.literal(true),
3117
+ data: z35.discriminatedUnion("credentialPurpose", [
3026
3118
  siteSetupBootstrapDataSchema,
3027
3119
  featureBootstrapDataSchema
3028
3120
  ])
@@ -3073,7 +3165,7 @@ async function collectSourceFiles(directory) {
3073
3165
  import { execFile as execFile2 } from "child_process";
3074
3166
  import { readFile as readFile9 } from "fs/promises";
3075
3167
  import { promisify as promisify2 } from "util";
3076
- import { z as z35 } from "zod";
3168
+ import { z as z36 } from "zod";
3077
3169
 
3078
3170
  // ../cli/dist/scan/next-source-scan.js
3079
3171
  import ts2 from "typescript";
@@ -3778,32 +3870,32 @@ function isPositionalFieldReference(value) {
3778
3870
 
3779
3871
  // ../cli/dist/commands/site-setup.js
3780
3872
  var execFileAsync2 = promisify2(execFile2);
3781
- var safeErrorSchema = z35.object({
3782
- code: z35.string().trim().min(1),
3783
- message: z35.string().trim().min(1)
3873
+ var safeErrorSchema = z36.object({
3874
+ code: z36.string().trim().min(1),
3875
+ message: z36.string().trim().min(1)
3784
3876
  }).passthrough();
3785
- var errorResponseSchema2 = z35.object({ ok: z35.literal(false), error: safeErrorSchema }).passthrough();
3786
- var contextDataSchema = z35.object({
3877
+ var errorResponseSchema2 = z36.object({ ok: z36.literal(false), error: safeErrorSchema }).passthrough();
3878
+ var contextDataSchema = z36.object({
3787
3879
  task: siteSetupTaskSchema.refine((task) => task.run !== null)
3788
3880
  }).strict();
3789
- var contextResponseSchema = z35.object({ ok: z35.literal(true), data: contextDataSchema }).strict();
3790
- var applyDataSchema = z35.object({
3791
- status: z35.enum(["applied", "ready_for_review"]),
3792
- runId: z35.string().uuid().optional(),
3793
- contractVersionId: z35.string().uuid().optional(),
3794
- fieldContractHash: z35.string().regex(/^sha256:[0-9a-f]{64}$/u),
3795
- editorDefinitionHash: z35.string().regex(/^sha256:[0-9a-f]{64}$/u).optional(),
3796
- fieldCount: z35.number().int().nonnegative().optional(),
3797
- routeCount: z35.number().int().nonnegative().optional()
3881
+ var contextResponseSchema = z36.object({ ok: z36.literal(true), data: contextDataSchema }).strict();
3882
+ var applyDataSchema = z36.object({
3883
+ status: z36.enum(["applied", "ready_for_review"]),
3884
+ runId: z36.string().uuid().optional(),
3885
+ contractVersionId: z36.string().uuid().optional(),
3886
+ fieldContractHash: z36.string().regex(/^sha256:[0-9a-f]{64}$/u),
3887
+ editorDefinitionHash: z36.string().regex(/^sha256:[0-9a-f]{64}$/u).optional(),
3888
+ fieldCount: z36.number().int().nonnegative().optional(),
3889
+ routeCount: z36.number().int().nonnegative().optional()
3798
3890
  }).strict();
3799
- var applyResponseSchema = z35.object({ ok: z35.literal(true), data: applyDataSchema }).strict();
3800
- var verifyDataSchema = z35.object({
3801
- status: z35.literal("ready_for_review"),
3802
- runId: z35.string().uuid().optional(),
3803
- deploymentOrigin: z35.string().url().optional(),
3804
- deploymentRevision: z35.string().optional()
3891
+ var applyResponseSchema = z36.object({ ok: z36.literal(true), data: applyDataSchema }).strict();
3892
+ var verifyDataSchema = z36.object({
3893
+ status: z36.literal("ready_for_review"),
3894
+ runId: z36.string().uuid().optional(),
3895
+ deploymentOrigin: z36.string().url().optional(),
3896
+ deploymentRevision: z36.string().optional()
3805
3897
  }).strict();
3806
- var verifyResponseSchema = z35.object({ ok: z35.literal(true), data: verifyDataSchema }).strict();
3898
+ var verifyResponseSchema = z36.object({ ok: z36.literal(true), data: verifyDataSchema }).strict();
3807
3899
  async function siteSetupContextCommand(input) {
3808
3900
  const response = await postSiteSetup(input, "context", {});
3809
3901
  const parsed = contextResponseSchema.safeParse(response.payload);
@@ -3900,19 +3992,19 @@ async function readGitRevision(projectDir) {
3900
3992
  import { randomBytes, randomUUID as randomUUID4 } from "crypto";
3901
3993
  import { access as access4 } from "fs/promises";
3902
3994
  import { join as join9, relative as relative5 } from "path";
3903
- import { z as z36 } from "zod";
3904
- var bootstrapResponseSchema2 = z36.object({
3905
- ok: z36.literal(true),
3995
+ import { z as z37 } from "zod";
3996
+ var bootstrapResponseSchema2 = z37.object({
3997
+ ok: z37.literal(true),
3906
3998
  data: siteSetupBootstrapDataSchema
3907
3999
  }).strict();
3908
4000
 
3909
4001
  // ../cli/dist/commands/setup-review.js
3910
- import { z as z37 } from "zod";
3911
- var responseSchema2 = z37.object({
3912
- ok: z37.literal(true),
3913
- data: z37.object({
3914
- reviewUrl: z37.string().url(),
3915
- expiresAt: z37.string().datetime({ offset: true })
4002
+ import { z as z38 } from "zod";
4003
+ var responseSchema2 = z38.object({
4004
+ ok: z38.literal(true),
4005
+ data: z38.object({
4006
+ reviewUrl: z38.string().url(),
4007
+ expiresAt: z38.string().datetime({ offset: true })
3916
4008
  }).strict()
3917
4009
  }).strict();
3918
4010
 
@@ -3926,8 +4018,8 @@ import ts3 from "typescript";
3926
4018
  import { randomUUID as randomUUID6 } from "crypto";
3927
4019
  import { lstat as lstat3, mkdir as mkdir7, open as open4, readFile as readFile11, rm as rm4, rmdir } from "fs/promises";
3928
4020
  import { resolve as resolve2 } from "path";
3929
- import { z as z38 } from "zod";
3930
- var ownerSchema = z38.object({ pid: z38.number().int().positive(), nonce: z38.string().uuid() }).strict();
4021
+ import { z as z39 } from "zod";
4022
+ var ownerSchema = z39.object({ pid: z39.number().int().positive(), nonce: z39.string().uuid() }).strict();
3931
4023
 
3932
4024
  // ../cli/dist/config/build-provenance.js
3933
4025
  import { createHash as createHash3 } from "crypto";
@@ -3935,23 +4027,23 @@ import { execFile as execFile3 } from "child_process";
3935
4027
  import { lstat as lstat4, readFile as readFile12, writeFile as writeFile5, mkdir as mkdir8 } from "fs/promises";
3936
4028
  import { dirname as dirname8, isAbsolute as isAbsolute2, join as join11, relative as relative7, resolve as resolve3, sep as sep3 } from "path";
3937
4029
  import { isDeepStrictEqual, promisify as promisify3 } from "util";
3938
- import { z as z39 } from "zod";
4030
+ import { z as z40 } from "zod";
3939
4031
  var execute = promisify3(execFile3);
3940
4032
  var name = ".siteplane/build-source.json";
3941
- var oid = z39.string().regex(/^[0-9a-f]{40}$/u);
3942
- var entrySchema = z39.object({
3943
- path: z39.string().min(1).max(4096),
3944
- mode: z39.enum(["100644", "100755", "120000"]),
4033
+ var oid = z40.string().regex(/^[0-9a-f]{40}$/u);
4034
+ var entrySchema = z40.object({
4035
+ path: z40.string().min(1).max(4096),
4036
+ mode: z40.enum(["100644", "100755", "120000"]),
3945
4037
  oid
3946
4038
  }).strict();
3947
- var schema = z39.object({
3948
- version: z39.literal(2),
4039
+ var schema = z40.object({
4040
+ version: z40.literal(2),
3949
4041
  revision: oid,
3950
- commit: z39.string().min(1).max(1048576),
3951
- entries: z39.array(entrySchema).min(1).max(1e5),
3952
- providerConfigurations: z39.array(z39.object({
3953
- path: z39.string().max(4096).regex(/(?:^|\/)vercel\.json$/u),
3954
- source: z39.string().max(1048576)
4042
+ commit: z40.string().min(1).max(1048576),
4043
+ entries: z40.array(entrySchema).min(1).max(1e5),
4044
+ providerConfigurations: z40.array(z40.object({
4045
+ path: z40.string().max(4096).regex(/(?:^|\/)vercel\.json$/u),
4046
+ source: z40.string().max(1048576)
3955
4047
  }).strict()).max(1e3)
3956
4048
  }).strict();
3957
4049
  var gitHash = (type, content) => createHash3("sha1").update(`${type} ${content.length}\0`).update(content).digest("hex");
@@ -4051,7 +4143,7 @@ async function readBuildProvenance(projectDirectory) {
4051
4143
  const original = configurations.get(entry.path);
4052
4144
  if (contents && original && entry.mode !== "120000") {
4053
4145
  try {
4054
- const object = z39.record(z39.string(), z39.unknown());
4146
+ const object = z40.record(z40.string(), z40.unknown());
4055
4147
  const actual = object.parse(JSON.parse(contents.toString("utf8")));
4056
4148
  const expected = object.parse(JSON.parse(original));
4057
4149
  if (!Object.hasOwn(expected, "version") && actual.version === 2)
@@ -4105,38 +4197,38 @@ import { createHash as createHash4, randomBytes as randomBytes2, randomUUID as r
4105
4197
  import { access as access6, mkdir as mkdir9, mkdtemp, rm as rm5, writeFile as writeFile6 } from "fs/promises";
4106
4198
  import { tmpdir } from "os";
4107
4199
  import { join as join12 } from "path";
4108
- import { z as z40 } from "zod";
4109
- var envSchema = z40.object({
4110
- id: z40.string(),
4111
- key: z40.string(),
4112
- target: z40.array(z40.string()),
4113
- type: z40.string(),
4114
- comment: z40.string().optional(),
4115
- updatedAt: z40.number().optional()
4200
+ import { z as z41 } from "zod";
4201
+ var envSchema = z41.object({
4202
+ id: z41.string(),
4203
+ key: z41.string(),
4204
+ target: z41.array(z41.string()),
4205
+ type: z41.string(),
4206
+ comment: z41.string().optional(),
4207
+ updatedAt: z41.number().optional()
4116
4208
  });
4117
- var deploymentSchema = z40.object({
4118
- id: z40.string(),
4119
- projectId: z40.string(),
4120
- ownerId: z40.string().optional(),
4121
- target: z40.string().nullable(),
4122
- readyState: z40.string(),
4123
- createdAt: z40.number(),
4124
- url: z40.string(),
4125
- meta: z40.record(z40.string(), z40.unknown()).optional(),
4126
- gitSource: z40.object({ sha: z40.string().optional() }).nullable().optional()
4209
+ var deploymentSchema = z41.object({
4210
+ id: z41.string(),
4211
+ projectId: z41.string(),
4212
+ ownerId: z41.string().optional(),
4213
+ target: z41.string().nullable(),
4214
+ readyState: z41.string(),
4215
+ createdAt: z41.number(),
4216
+ url: z41.string(),
4217
+ meta: z41.record(z41.string(), z41.unknown()).optional(),
4218
+ gitSource: z41.object({ sha: z41.string().optional() }).nullable().optional()
4127
4219
  });
4128
- var buildProofSchema = z40.object({
4129
- node: z40.string(),
4130
- packageManager: z40.enum(["npm", "pnpm"]),
4131
- packageManagerVersion: z40.string(),
4132
- lockfileHash: z40.string(),
4133
- revision: z40.string(),
4134
- fieldContractHash: z40.string(),
4135
- siteplane: z40.string(),
4136
- runtimeNext: z40.string(),
4137
- analytics: z40.string().optional(),
4138
- next: z40.string(),
4139
- react: z40.string()
4220
+ var buildProofSchema = z41.object({
4221
+ node: z41.string(),
4222
+ packageManager: z41.enum(["npm", "pnpm"]),
4223
+ packageManagerVersion: z41.string(),
4224
+ lockfileHash: z41.string(),
4225
+ revision: z41.string(),
4226
+ fieldContractHash: z41.string(),
4227
+ siteplane: z41.string(),
4228
+ runtimeNext: z41.string(),
4229
+ analytics: z41.string().optional(),
4230
+ next: z41.string(),
4231
+ react: z41.string()
4140
4232
  }).strict();
4141
4233
  var defaults = {
4142
4234
  preflight: setupPreflightCommand,
@@ -4152,7 +4244,7 @@ var defaults = {
4152
4244
  };
4153
4245
 
4154
4246
  // ../cli/dist/commands/setup-claim.js
4155
- import { z as z41 } from "zod";
4247
+ import { z as z42 } from "zod";
4156
4248
 
4157
4249
  // src/next.ts
4158
4250
  var SiteplaneNextContractError = class extends Error {
@@ -4216,7 +4308,7 @@ async function withSiteplane(nextConfig, options = {}) {
4216
4308
  const imageOrigin = hasImages ? readImageWebsiteOrigin() : null;
4217
4309
  return {
4218
4310
  ...nextConfig,
4219
- ...imageOrigin ? { images: prepareImagePatterns(nextConfig.images, imageOrigin) } : {},
4311
+ ...hasImages ? { images: prepareImagePatterns(nextConfig.images, imageOrigin) } : {},
4220
4312
  headers: async () => frameHeaders(
4221
4313
  await nextConfig.headers?.() ?? [],
4222
4314
  new URL(config.apiBaseUrl).origin,
@@ -4243,40 +4335,24 @@ async function readGitRevision2(projectDir) {
4243
4335
  }
4244
4336
  function frameHeaders(rules, adminOrigin, imageOrigin) {
4245
4337
  const policy = `frame-ancestors 'self' ${adminOrigin}`;
4338
+ const hasFrameOptions = rules.some((rule) => rule.headers.some((header) => header.key.toLowerCase() === "x-frame-options"));
4246
4339
  const prepared = rules.map((rule) => ({
4247
4340
  ...rule,
4248
4341
  headers: rule.headers.map((header) => {
4249
- if (header.key.toLowerCase() === "x-frame-options" && /^(DENY|SAMEORIGIN)$/iu.test(header.value.trim()))
4250
- throw new SiteplaneNextContractError(
4251
- "frame_policy_conflict",
4252
- "The existing X-Frame-Options blocks the Siteplane preview. Reconcile that explicit website policy with the canonical admin origin."
4253
- );
4254
4342
  if (header.key.toLowerCase() !== "content-security-policy") return header;
4255
- const ancestors = /(?:^|;)\s*frame-ancestors\s+([^;]+)/iu.exec(
4256
- header.value
4257
- )?.[1];
4258
- if (ancestors && (!ancestors.split(/\s+/u).includes(adminOrigin) || ancestors.includes("*")))
4259
- throw new SiteplaneNextContractError(
4260
- "frame_policy_conflict",
4261
- "Keep the existing CSP directives and explicitly allow only the canonical Siteplane admin origin in frame-ancestors."
4262
- );
4263
- const value = ancestors ? header.value : `${header.value.replace(/;\s*$/u, "")}; ${policy}`;
4264
- return {
4265
- ...header,
4266
- value: imageOrigin ? prepareImageCsp(value, imageOrigin) : value
4267
- };
4343
+ const ancestors = /(?:^|;)\s*frame-ancestors\s+([^;]+)/iu.test(header.value);
4344
+ const value = ancestors || hasFrameOptions ? header.value : `${header.value.replace(/;\s*$/u, "")}; ${policy}`;
4345
+ return { ...header, value: imageOrigin ? prepareImageCsp(value, imageOrigin) : value };
4268
4346
  })
4269
4347
  }));
4270
- return [
4271
- {
4272
- source: "/:path*",
4273
- headers: [{ key: "Content-Security-Policy", value: policy }]
4274
- },
4348
+ return hasFrameOptions ? prepared : [
4349
+ { source: "/:path*", headers: [{ key: "Content-Security-Policy", value: policy }] },
4275
4350
  ...prepared
4276
4351
  ];
4277
4352
  }
4278
4353
  var managedImageOrigin = "https://siteplane.io";
4279
4354
  function readImageWebsiteOrigin() {
4355
+ if (!process.env.SITEPLANE_SITE_ORIGIN) return null;
4280
4356
  try {
4281
4357
  const value = process.env.SITEPLANE_SITE_ORIGIN;
4282
4358
  const url = new URL(value ?? "");
@@ -4286,16 +4362,17 @@ function readImageWebsiteOrigin() {
4286
4362
  } catch {
4287
4363
  throw new SiteplaneNextContractError(
4288
4364
  "image_origin_missing",
4289
- "Image fields require SITEPLANE_SITE_ORIGIN to be the exact public HTTPS website origin. setup deploy sets it from the verified provider domain; use that same origin for local builds. Never substitute a wildcard or private host."
4365
+ "If configured, SITEPLANE_SITE_ORIGIN must be the exact public HTTPS website origin. setup deploy sets it from the verified provider domain; local fallback-image builds can omit it. Never substitute a wildcard or private host."
4290
4366
  );
4291
4367
  }
4292
4368
  }
4293
4369
  function prepareImagePatterns(images, websiteOrigin) {
4294
4370
  const remotePatterns = [...images?.remotePatterns ?? []];
4295
- for (const [origin, pathname] of [
4296
- [managedImageOrigin, "/api/assets/*/content"],
4297
- [websiteOrigin, "/siteplane-assets/**"]
4298
- ]) {
4371
+ const destinations = [
4372
+ [managedImageOrigin, "/api/assets/*/content"]
4373
+ ];
4374
+ if (websiteOrigin) destinations.push([websiteOrigin, "/siteplane-assets/**"]);
4375
+ for (const [origin, pathname] of destinations) {
4299
4376
  const pattern = {
4300
4377
  protocol: "https",
4301
4378
  hostname: new URL(origin).hostname,