@vcp-dev/contracts 0.10.48 → 0.10.49
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/index.js +1 -1
- package/dist/site-edit-version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -65,4 +65,4 @@ export default function DetailBreadcrumb({ seo, title }: DetailBreadcrumbProps)
|
|
|
65
65
|
</Breadcrumb>
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
-
`}import{z as un}from"zod";var Zv="SITE_HAS_ACTIVE_SUBSITES",Jv="SITE_HAS_SUBSITES",uf=un.object({site_id:k,name:un.string().min(1),mount_path:un.string().min(1),archived_at:un.string().nullable()}),eD=un.object({subsites:un.array(uf)});import{z as Ce}from"zod";var iD=Ce.object({key:Ce.string().min(1),composition:he}).strict(),Xs=Ce.enum(["component-boundary","repeat-region","conditional-region","fragment-region","opaque-region"]),_f=Ce.enum(["direct","proxy","upstream","readonly","unsupported"]),gf=Ce.enum(["component-boundary","repeat-region","conditional-region","opaque-region","void-element","read-only","cross-file-required","import-required"]),Ys=Ce.object({mode:_f,reasonCode:Ce.string().min(1).optional()}),hf=Ce.object({kind:gf,message:Ce.string().min(1)}),Qs=Ce.object({composition:z,key:Ce.string().min(1),canUpdateText:Ce.boolean(),canInsertChild:Ce.boolean(),canMove:Ce.boolean(),canRemove:Ce.boolean(),editModes:Ce.object({updateText:Ys.optional(),insertChild:Ys.optional(),move:Ys.optional(),remove:Ys.optional()}).optional(),constraints:Ce.array(hf)}).strict();import{z as Q}from"zod";var pD=Q.discriminatedUnion("type",[Q.object({type:Q.literal("site-edit.document.changed"),siteId:k,snapshotId:I,composition:z,version:Q.number().int().nonnegative(),at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.operation.planned"),siteId:k,operationId:Q.string().min(1),baseSnapshotId:I,composition:z,changedFiles:Q.array(Q.string().min(1)),at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.operation.completed"),siteId:k,composition:z,result:la,at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.operation.failed"),siteId:k,composition:z,requestId:Q.string().min(1),error:Lc,at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.capability.changed"),siteId:k,composition:z,keys:Q.array(Q.string().min(1)),at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.graph.invalidated"),siteId:k,composition:z,at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.graph.ready"),siteId:k,composition:z,version:Q.number().int().nonnegative(),at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.graph.error"),siteId:k,composition:z,message:Q.string().min(1),at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.snapshot.changed"),siteId:k,composition:z,snapshotId:I,previousSnapshotId:Q.string().min(1).nullable(),at:Q.string().min(1)}).strict()]);import{z as me}from"zod";var gD="durable-history-v1",Zs=me.object({initiatingComposition:z.optional(),affectedCompositions:me.array(z)}).strict(),hD=me.enum(["writable","read-only-recovery","unavailable"]),Sf=me.enum(["INDEX_CORRUPT","ENTRY_MISSING","BLOB_MISSING","FILESYSTEM_UNAVAILABLE","ROLLBACK_INCOMPLETE","UNKNOWN"]),ff=me.object({code:Sf,message:me.string().min(1),occurredAt:me.iso.datetime().optional()}).strict(),bf=me.enum(["NOT_INITIALIZED","FILESYSTEM_UNAVAILABLE","UNSUPPORTED_RUNTIME"]),Cm={revision:me.number().int().nonnegative(),undoDepth:me.number().int().nonnegative(),redoDepth:me.number().int().nonnegative()},yf=me.object({mode:me.literal("writable"),composition:z,...Cm,canUndo:me.boolean(),canRedo:me.boolean(),provenance:Zs.optional()}).strict().superRefine((e,n)=>{e.canUndo!==e.undoDepth>0&&n.addIssue({code:"custom",path:["canUndo"],message:"canUndo must reflect undoDepth."}),e.canRedo!==e.redoDepth>0&&n.addIssue({code:"custom",path:["canRedo"],message:"canRedo must reflect redoDepth."})}),xf=me.object({mode:me.literal("read-only-recovery"),composition:z,...Cm,canUndo:me.literal(!1),canRedo:me.literal(!1),recoveryDiagnostic:ff,provenance:Zs.optional()}).strict(),Ef=me.object({mode:me.literal("unavailable"),composition:z,revision:me.literal(0),undoDepth:me.literal(0),redoDepth:me.literal(0),canUndo:me.literal(!1),canRedo:me.literal(!1),reason:bf,provenance:Zs.optional()}).strict(),Rf=me.discriminatedUnion("mode",[yf,xf,Ef]),SD=me.object({composition:z,status:Rf,provenance:Zs}).strict();import{z as Y}from"zod";var Js=Y.enum(["api-field","cms-field","i18n-message","config-entry"]),Fa=Y.object({kind:Y.enum(["jsx-node","value-path","route-export","external-entry"]),file:Y.string().min(1).optional(),isProxy:Y.boolean(),displayPath:Y.string().min(1).optional(),sourceType:Js.optional(),sourceId:Y.string().min(1).optional()}),If=Y.discriminatedUnion("status",[Y.object({status:Y.literal("resolved"),value:Ht}).strict(),Y.object({status:Y.literal("undefined")}).strict(),Y.object({status:Y.literal("unresolved")}).strict()]),Tf=Y.object({kind:Y.enum(["literal","boolean-shorthand","expression","binding","repeat-template"]),raw:Y.string().optional()}).strict(),kf=Y.object({name:Y.string().min(1),source:Tf,resolution:If,editMode:Y.enum(["direct","proxy","upstream","readonly","unsupported"]),sourceScope:Y.enum(["node","repeat-item","repeat-template"]),allowedWriteScopes:Y.array(Y.enum(["selection","template"])),effectiveWriteTarget:Fa.optional(),diagnostics:Y.array(Y.object({code:Y.string().min(1),message:Y.string().min(1)}).strict())}).strict(),Af=Y.object({raw:Y.string().min(1),sourceRange:gt,order:Y.number().int().nonnegative(),diagnostics:Y.array(Y.object({code:Y.string().min(1),message:Y.string().min(1)}).strict())}).strict(),wf=Y.object({selection:Y.enum(["direct","materialize","unsupported"]),template:Y.enum(["direct","unsupported"])}).strict(),Ga=Y.object({documentVersion:Y.number().int().nonnegative(),selectionRef:rn.optional(),items:Y.array(kf),spreads:Y.array(Af),creation:wf}).strict().superRefine((e,n)=>{let s=e.selectionRef;s&&s.instanceIndex!==void 0&&s.instanceCount!==void 0&&s.instanceIndex>=s.instanceCount&&n.addIssue({code:"custom",path:["selectionRef","instanceIndex"],message:"instanceIndex must be smaller than instanceCount"})});import{z as ve}from"zod";var Pf=ve.string().min(1).refine(e=>!e.startsWith("/")&&!e.includes(".."),{message:"Patch paths must be safe relative POSIX paths."}),Cf=ve.string().regex(/^sha256:[a-f0-9]{64}$/),vf=ve.object({path:Pf,operation:ve.enum(["create","update","delete"]),expectedHash:Cf.optional(),fullContent:ve.string().optional()}).superRefine((e,n)=>{e.operation==="delete"&&e.fullContent!==void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"delete patches must not include fullContent"}),e.operation!=="delete"&&e.fullContent===void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"create/update patches must include fullContent"})}),Df=ve.object({siteId:k,baseSnapshotId:I,operationId:ve.string().min(1),reason:ve.string().min(1),patches:ve.array(vf).min(1),changedCompositions:ve.array(z),changedRouteIds:ve.array(ve.string().min(1)).optional(),diagnostics:ve.array(ve.object({code:ve.string().min(1),message:ve.string().min(1),path:ve.string().min(1).optional()})).default([])}).strict().superRefine((e,n)=>{let s=new Set;for(let[a,o]of e.patches.entries())s.has(o.path)&&n.addIssue({code:"custom",path:["patches",a,"path"],message:`Duplicate patch path: ${o.path}`}),s.add(o.path);let i=[...new Set(e.changedCompositions.map(a=>a.routeId))];e.changedRouteIds!==void 0&&(e.changedRouteIds.length!==i.length||e.changedRouteIds.some((a,o)=>a!==i[o]))&&n.addIssue({code:"custom",path:["changedRouteIds"],message:"changedRouteIds must be the stable deduplicated route projection of changedCompositions."})}),AD=Df.transform(e=>({...e,changedRouteIds:[...new Set(e.changedCompositions.map(n=>n.routeId))]}));var qa="::repeat-item#";function Of(e,n){return`${e}${qa}${n}`}function PD(e,n){return n.reduce((s,i)=>Of(s,i),e)}function Nf(e){if(typeof e!="string"||e.length===0)return null;let n=[],s=e;for(;;){let i=s.lastIndexOf(qa);if(i<0)break;let a=Number(s.slice(i+qa.length));if(!Number.isInteger(a)||a<0)return null;n.unshift({repeatIndex:a}),s=s.slice(0,i)}return!s||n.length===0?null:{baseKey:s,parts:n}}function CD(e){return Nf(e)?.baseKey??e??null}import{z as l}from"zod";import{z as Ue}from"zod";var jf=Ue.object({placementKey:Ue.string().min(1),placementUnitKey:Ue.string().min(1),relation:Ue.enum(["before","after","prepend","append"])}).strict(),Lf=Ue.object({status:Ue.literal("supported"),containerKey:Ue.string().min(1),hasBusinessMembers:Ue.boolean(),placementUnitKeys:Ue.array(Ue.string().min(1)),placements:Ue.array(jf)}).strict().superRefine((e,n)=>{let s=new Set(e.placementUnitKeys);s.size!==e.placementUnitKeys.length&&n.addIssue({code:"custom",path:["placementUnitKeys"],message:"Render page composition placement unit keys must be unique."});let i=new Set;e.placements.forEach((a,o)=>{i.has(a.placementKey)&&n.addIssue({code:"custom",path:["placements",o,"placementKey"],message:"Render page composition placement keys must be unique."}),i.add(a.placementKey),s.has(a.placementUnitKey)||n.addIssue({code:"custom",path:["placements",o,"placementUnitKey"],message:"Render page composition placement must reference a projected unit."})})}),Mf=Ue.object({status:Ue.literal("unsupported"),reason:Ms,diagnostics:Ue.array(Bn)}).strict(),vm=Ue.discriminatedUnion("status",[Lf,Mf]);var Uf=l.object({canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean()}),Dm=l.enum(["vcp-cms-collection","vcp-cms-form","vcp-cms-settings","vcp-cms-navigation","site-api-route","external-api","unknown-api"]),Ff=l.enum(["cms-field","api-field"]),Gf=l.enum(["text","attribute","richtext","repeat-region","conditional-region","component-prop"]),qf=l.enum(["exact","safe-derived","partial","unknown"]),Wf=l.object({file:l.string().min(1),symbol:l.string().min(1).optional(),reason:l.string().min(1)}),Bf=l.object({sourceKind:Dm,sourceType:Ff,endpointPattern:l.string().min(1).optional(),operation:l.string().min(1).optional(),collection:l.string().min(1).optional(),fieldPath:l.string().min(1).optional(),valuePath:l.string().min(1).optional(),targetKind:Gf,targetName:l.string().min(1),confidence:qf,readonly:l.literal(!0),evidence:l.array(Wf)}),Om=l.object({hasDynamicData:l.boolean(),bindings:l.array(Bf)}),Nm=l.object({hasDynamicData:l.boolean(),sourceKinds:l.array(Dm),collections:l.array(l.string().min(1)).min(1).optional(),primaryEndpoint:l.string().min(1).optional(),primaryCollection:l.string().min(1).optional(),primaryFieldPath:l.string().min(1).optional()}),Kf=l.discriminatedUnion("kind",[l.object({kind:l.literal("route-unit")}).strict(),l.object({kind:l.literal("source-siblings"),siblingKeys:l.array(l.string().min(1)).min(2)}).strict(),l.object({kind:l.literal("unavailable")}).strict()]),zf=l.object({key:l.string().min(1),parentKey:l.string().min(1).nullable().optional(),pageCompositionUnitKey:l.string().min(1).optional(),pageCompositionActionScope:Kf.optional(),operationSummary:Uf,dynamicDataSummary:Nm.optional()}).strict(),$D=l.object({composition:he}).strict(),VD=l.object({key:l.string().min(1),composition:he,selectionRef:rn.optional()}).strict(),YD=l.object({siteId:k,snapshotId:I,composition:z,version:l.number().int().nonnegative(),entries:l.array(zf),pageComposition:vm}).strict(),jm=l.object({kind:l.enum(["literal","binding","imported-binding","repeat-template"]),file:l.string().min(1),expression:l.string().min(1),bindingName:l.string().min(1).optional(),path:l.array(l.union([l.string(),l.number()])).optional()}),Wa=l.object({index:l.number().int().min(0),value:l.string(),editable:l.boolean(),source:jm.nullable()}),Qn=l.object({key:l.string().min(1),label:l.string().min(1),tag:l.string().min(1)}),XD=l.object({composition:z,key:l.string().min(1),canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean(),boundaryKind:Xs.nullable(),isOpaque:l.boolean()}).strict(),Hf=l.object({kind:l.enum(["jsx-node","component-proxy","value-binding","route-export"]),file:l.string().min(1),componentName:l.string().min(1),isProxy:l.boolean()}),Lm=l.object({kind:l.union([l.enum(["jsx-literal","component-prop","binding","imported-binding","object-field","array-item","repeat-template","conditional-branch"]),Js]),file:l.string().min(1),displayPath:l.string().min(1),externalSource:l.object({sourceType:Js,sourceId:l.string().min(1),adapterId:l.string().min(1).optional()}).optional()}),$f=l.object({kind:Lm.shape.kind,file:l.string().min(1),displayName:l.string().min(1),canEditHere:l.boolean()}),Zn=l.object({finalSource:Lm.nullable(),chain:l.array($f),confidence:l.enum(["exact","safe-derived","partial","unknown"]),editMode:l.enum(["direct","proxy","upstream","readonly","unsupported"]),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)}))}),Vf=l.object({kind:l.literal("css-style-model"),properties:l.array(l.object({property:Cc,value:l.union([l.string(),l.number(),l.boolean(),l.null()]),resolvedValue:l.union([l.string(),l.number(),l.boolean(),l.null()]).optional(),breakpoint:Dc.optional(),state:vc.optional(),variants:l.array(l.string().min(1)).optional(),options:l.array(l.union([l.string(),l.number()])).optional(),editable:l.boolean(),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)})).optional(),operationBoundary:l.array(Kn).optional()}))}),QD=l.union([l.record(l.string(),l.unknown()),Vf]),Mm=l.object({kind:l.literal("class-name-source"),className:l.string(),sourceKind:l.enum(["missing","static-attribute","static-expression","dynamic-expression"]),editable:l.boolean(),operationBoundary:l.array(Kn),sourcePath:l.string().min(1).optional(),diagnostics:l.array(l.object({code:l.enum(["missing-class-name","dynamic-binding","non-string-binding"]),message:l.string().min(1)})).optional()}),Yf=l.object({startLine:l.number().int().positive(),startColumn:l.number().int().nonnegative(),endLine:l.number().int().positive(),endColumn:l.number().int().nonnegative()}),Ba=l.object({sourceFile:l.string().min(1),componentName:l.string().min(1),openingElementRange:Yf,structuralPath:l.string().min(1),textPreview:l.string().min(1).optional()}),Um=l.enum(["native-anchor","next-link","unsupported"]),ZD=l.object({composition:z,key:l.string().min(1),tag:l.string().min(1),linkSourceKind:Um.optional(),componentName:l.string().min(1),sourceFile:l.string().min(1),sourceLocator:Ba.optional(),label:l.string().min(1),capabilities:Qs,writeTarget:Hf,effectiveWriteTarget:Fa.optional(),provenanceChain:Zn.optional(),componentSemantic:l.record(l.string(),l.unknown()).optional(),styleSource:Mm.optional(),conditional:l.record(l.string(),l.unknown()).optional(),dynamicData:Om.optional(),properties:Ga.optional(),textSegments:l.array(Wa),boundaryKind:Xs.nullable(),isOpaque:l.boolean(),ancestors:l.array(Qn),children:l.array(Qn),siblings:l.array(Qn)}).strict(),JD=l.object({composition:z,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:Ba.optional(),capabilities:l.object({constraints:Qs.shape.constraints}),isOpaque:l.boolean(),provenanceChain:l.object({editMode:Zn.shape.editMode,diagnostics:Zn.shape.diagnostics}).optional(),dynamicDataSummary:Nm.optional(),ancestors:l.array(Qn)}).strict(),eO=l.object({composition:z,key:l.string().min(1),tag:l.string().min(1),linkSourceKind:Um.optional(),label:l.string().min(1),sourceLocator:Ba.optional(),isOpaque:l.boolean(),ancestors:l.array(Qn),componentName:l.string().min(1),sourceFile:l.string().min(1),capabilities:Qs,provenanceChain:l.object({editMode:Zn.shape.editMode,diagnostics:Zn.shape.diagnostics}).optional(),textSegments:l.array(l.object({index:Wa.shape.index,editable:Wa.shape.editable,sourceKind:jm.shape.kind.nullable()})),dynamicData:Om.optional(),properties:Ga.optional(),boundaryKind:Xs.nullable()}).strict(),tO=l.object({composition:z,key:l.string().min(1),styleSource:Mm.optional()}).strict();var Xf=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Qf=["article","aside","div","footer","form","header","li","main","nav","ol","section","select","table","tbody","tfoot","thead","tr","ul"],Zf=["a","button","em","h1","h2","h3","h4","h5","h6","label","p","small","span","strong"],Jf=new Set(Xf),eb=new Set(Qf),tb=new Set(Zf),nb={canUpdateText:!1,canInsertChild:!1,canMove:!1,canRemove:!1};function sO(e){return Jf.has(Ka(e))}function sb(e){return eb.has(Ka(e))}function ib(e){return tb.has(Ka(e))}function iO(e){let{operationSummary:n}=e;return n?{canUpdateText:n.canUpdateText,canInsertChild:n.canInsertChild,canMove:n.canMove,canRemove:n.canRemove}:e.fallbackMode!=="preview"?{...nb}:{canUpdateText:ib(e.tagName),canInsertChild:sb(e.tagName),canMove:!1,canRemove:!1}}function Ka(e){return e?.trim().toLowerCase()??""}import{z as ab}from"zod";var mO=ab.object({composition:he,mutationContext:qn.optional()}).strict();var pO={PATCH_VALIDATION_FAILED:"The code didn't pass validation. Try describing the change more specifically.",PATCH_BATCH_FAILED:"The site code couldn't be generated. Please regenerate the site.",PATCH_BATCH_INVALID:"The change couldn't be applied. Try simpler instructions.",VALIDATION_FAILED:"Your message couldn't be sent as written. Please edit it and try again.",WORKSPACE_MESSAGE_CONTAINS_SECRET:"Your message looks like it contains a secret or token, so it wasn't sent. Remove it and try again.",WORKSPACE_RUN_INPUT_REQUIRED:"Nothing to work on: the request had no instruction, so no edit was started. Describe the change you want and send it.",WORKSPACE_TOOL_RESULT_INVALID:"This change couldn't be completed and was rolled back. Please try again.",WORKSPACE_TOOL_FAILED:"A tool step failed. Please try again.",WORKSPACE_TOOL_RESULT_MISSING:"The tool didn't return a usable result. Please try again.",WORKSPACE_MODEL_STREAM_FAILED:"The model stream ended unexpectedly. Please try again.",WORKSPACE_MODEL_STREAM_ABORTED:"Generation was interrupted before finishing. Please try again.",MODEL_OUTPUT_TRUNCATED:"The response was too long and was cut off before any change was applied. Try again, or split the request into smaller changes.",WORKSPACE_EDIT_NOT_APPLIED:"No change was applied. Try describing the change differently.",PRODUCT_SEARCH_APPLY_NOT_AVAILABLE:"Product search changes aren't available yet. Please try again later.",WORKSPACE_INITIAL_EXECUTION_FAILED:"Initial generation failed. Please retry from the brief.",WORKSPACE_INITIAL_GENERATION_CHECK_FAILED:"Initial generation could not be verified. Please retry.",WORKSPACE_INITIAL_GENERATION_FINALIZE_FAILED:"Initial generation could not finalize. Please retry.",WORKSPACE_INITIAL_GENERATION_QUALITY_GATE_FAILED:"Initial generation failed quality checks. Please regenerate the site.",WORKSPACE_CHECK_INCOMPLETE:"The check couldn't complete, so no page was delivered this round. Please regenerate the site.",WORKSPACE_RUN_RESUME_EXHAUSTED:"Generation was interrupted several times and stopped. Everything already saved is kept; you can regenerate the missing pages.",WORKSPACE_GENERATION_STOPPED:"You stopped this generation before any page was ready. Nothing was lost \u2014 start it again when you want.",WORKSPACE_FILL_IN_INTERRUPTED:"The fill-in run was interrupted and stopped. Your site is unchanged; select the targets again to retry.",WORKSPACE_RUN_LEASE_SUPERSEDED:"Another attempt took over this run, so this one stopped. Reload to see the current progress.",FILL_IN_NOT_AVAILABLE:"Fill-in is available after the site has been generated.",FILL_IN_TARGET_NOT_OMITTED:"One of the selected items is no longer listed as missing. Reload the omissions list and try again.",FILL_IN_TARGET_MODIFIED:"One of the selected items was changed or removed after generation, so it was not filled in. Your edits are kept.",WORKSPACE_ITERATION_QUALITY_GATE_FAILED:"Quality check failed. The change was rolled back; try a smaller or more specific request.",WORKSPACE_RESOURCE_MATERIALIZATION_FAILED:"The resource couldn't be prepared. Check its file format, dependencies, and target paths before trying again.",DESIGNER_PAGE_RESOURCE_INCOMPATIBLE:"This template contains files or dependencies the page editor doesn't support. Choose another template or adapt the resource package first.",WORKSPACE_SOCKET_DEAD:"The workspace connection was lost. Please retry.",WORKSPACE_RUN_CANCELLED:"The run was cancelled.",WORKSPACE_RUN_ABANDONED:"This run was interrupted and did not finish. Please try again.",WORKSPACE_RUN_REQUEST_FAILED:"Couldn't start the workspace. Please try again.",WORKSPACE_RUN_BAD_RESPONSE:"The server response was malformed. Please try again.",WORKSPACE_SOCKET_UNAVAILABLE:"Workspace connection unavailable. Please try again.",WORKSPACE_SOCKET_ERROR:"The workspace connection had an error. Please try again.",WORKSPACE_SOCKET_CLOSED:"The workspace connection closed. Please try again.",WORKSPACE_SOCKET_OPEN_TIMEOUT:"Couldn't reach the workspace in time. Please try again.",WORKSPACE_CLIENT_MESSAGE_ID_MISSING:"Something went wrong sending your message. Please try again.",SITE_SNAPSHOT_REQUIRED:"This site has no usable snapshot yet. Complete Step 3 first.",AGENT_TIMEOUT:"That took longer than expected. Try breaking the change into smaller pieces.",SANDBOX_NOT_AVAILABLE:"The preview environment isn't ready. Your edits have still been saved.",PREVIEW_BUILD_FAILED:"Preview is available, but the production build failed. Fix the reported build error before deploying.",PREVIEW_BUILD_NOT_CONFIGURED:"Preview is available, but the production build check is not configured.",PREVIEW_BUILD_SANDBOX_NOT_FOUND:"Preview is available, but the build check could not find the active preview sandbox.",BUILD_FONT_METADATA_INVALID:"We couldn't read the font file information. Publishing is blocked until the font file is checked.",BUILD_FONT_LICENSE_UNKNOWN:"We couldn't verify this font's license. Publishing is blocked until its license is confirmed.",BUILD_FONT_LICENSE_CONFLICT:"The font file license conflicts with the verified record. Publishing is blocked until the conflict is resolved.",BUILD_FONT_LICENSE_TEXT_MISSING:"The complete font license text is missing. Publishing is blocked until it is provided.",BUILD_FONT_LICENSE_DELIVERY_FAILED:"We couldn't include the font license files in the deployment. Please try publishing again.",WS_CONNECTION_ERROR:"Connection lost. Reconnecting\u2026",USER_MESSAGE_PERSIST_FAILED:"Your message wasn't saved. Please send it again.",CLARIFICATION_REPLY_STALE:"That question has expired. Please tell me what you'd like to do now.",CLARIFY_MODEL_FAILED:"Clarify couldn't finish generating questions. Please try again.",WORKSPACE_RUN_IN_FLIGHT:"Another session is already running. Please try again in a moment.",SITE_OPERATION_LOCKED:"Another change is already running for this site. Wait for it to finish, then try again.",SITE_SITEMAP_DRAFT_STALE:"The draft was updated elsewhere. Reload the latest draft before saving.",SITE_SITEMAP_DRAFT_OPERATION_MISMATCH:"This save identity belongs to a different draft operation.",WORKSPACE_THREAD_NOT_FOUND:"That conversation no longer exists. Switching back to the default conversation.",WORKSPACE_THREAD_ARCHIVED:"This conversation is archived. Start a new one to continue.",WORKSPACE_THREAD_BUSY:"This conversation is still running. Wait for it to finish before archiving.",WORKSPACE_THREAD_READ_ONLY:"Background conversations are read-only here.",WORKSPACE_THREAD_INVALID:"This conversation can't accept new requests right now. Refresh and try again.",EDIT_ENGINE_VERSION_INVALID:"Invalid editor version. Refresh the page and try again.",SANDBOX_DEPENDENCY_SYNC_FAILED:"The preview runtime could not be prepared. Please try again.",SANDBOX_PREVIEW_FAILED:"The site preview failed to start. Please try again.",SANDBOX_DEPENDENCY_VERSION_MISMATCH:"The preview runtime could not be verified. Please try again.",SANDBOX_RUNTIME_NOT_READY:"The preview needs to be refreshed before this change can be applied. Refresh the preview and try again.",GENERIC:"Something went wrong. Please try again."},ob=["BUILD_FONT_METADATA_INVALID","BUILD_FONT_LICENSE_UNKNOWN","BUILD_FONT_LICENSE_CONFLICT","BUILD_FONT_LICENSE_TEXT_MISSING","BUILD_FONT_LICENSE_DELIVERY_FAILED"],rb=new Set(ob);function dO(e){return typeof e=="string"&&rb.has(e)}var cb=["WORKSPACE_RUN_CANCELLED","WORKSPACE_GENERATION_STOPPED"],mb=new Set(cb);function uO(e){return typeof e=="string"&&mb.has(e)}var _O={UNDO_OR_ROLLBACK:"I can't roll back from chat. Use the version history at the top right to pick a restore point.",HISTORY_RECALL:"Tell me what you'd like to change now\u2014I'll work from the current page state.",OUT_OF_SCOPE:"That's outside what I can do from chat. Try the corresponding panel on the right."},gO={CARD_HEADER:"Needs your confirmation",FREE_TEXT_PLACEHOLDER:"Or describe what you'd like instead",SUBMIT_LABEL:"Submit"},hO={SEND_FAILED_RETRY:"Send failed \u2014 tap to retry"};var Fm="0.10.48",fO="x-vcp-edit-engine-version",bO="x-vcp-edit-engine-version-source",za=class extends Error{constructor(n="Invalid edit-engine version."){super(n),this.code="EDIT_ENGINE_VERSION_INVALID",this.name="EditEngineVersionParseError"}},lb=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/;function pb(e){return lb.test(e)}function db(e){if(typeof e!="string"||!pb(e))throw new za;return e}function yO(e){return e==null?{version:Fm,source:"fallback_current"}:{version:db(e),source:"explicit"}}function xO(){return{version:Fm,source:"system_current"}}import{z as nt}from"zod";var ub=200,_b=200;function gb(e){let n=e.indexOf(":");if(n<=0)return null;let s=e.slice(0,n).trim(),i=e.slice(n+1).trim();return s.length===0||i.length===0?null:{source:s,target:i}}var hb=nt.string().min(3).max(ub).refine(e=>gb(e)!==null,{message:'glossary entries must be "source:target" pairs split on a half-width colon, e.g. "\u7C73:Rice"'}),IO=nt.array(hb).max(_b),TO=nt.object({website_name:nt.string().min(1).max(200),website_industry:nt.string().min(1).max(200).optional(),website_description:nt.string().min(1).max(1e3).optional()}),Sb=nt.enum(["regional","fonts_only"]),ei=nt.string().regex(/^#[0-9a-fA-F]{6}$/,'color must be a "#rrggbb" value'),fb=nt.object({primary:ei.optional(),accent:ei.optional(),foreground:ei.optional(),neutral:ei.optional()}),bb=600,kO=nt.object({mode:Sb.default("regional"),seeds:fb.optional(),note:nt.string().min(1).max(bb).optional()}),AO={mode:"regional"};function wO(e){return e===void 0?!1:Object.values(e).some(n=>typeof n=="string"&&n.length>0)}import{z as Vt}from"zod";var yb=12,DO=Vt.object({tenant_id:Vt.string().min(1),site_id:k,snapshot_id:I,manifest_hash:Vt.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:Vt.string().min(1).max(2048)}),ti=Vt.number().int().nonnegative().safe(),OO=Vt.object({page_count:ti,translation_character_count:ti,image_estimate:Vt.object({media_key_count:ti,max_replacement_count:ti})}).superRefine((e,n)=>{let{media_key_count:s,max_replacement_count:i}=e.image_estimate;i!==Math.min(s,yb)&&n.addIssue({code:"custom",path:["image_estimate","max_replacement_count"],message:"max replacement count does not match the deterministic ceiling"})});import{z as _e}from"zod";var xb=_e.string().trim().min(1),_n=_e.string().uuid(),Eb=_e.string().min(1).max(2048).refine(e=>e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."),"object_key must be a relative snapshot store path without empty, '.' or '..' segments"),Gm=_e.object({snapshot_id:_n,object_key:Eb}),LO=_e.object({tenant_id:xb,parent_site_id:_n,subsite_site_id:_n,base:Gm,target:Gm}),Rb=_e.object({page_path:_e.string().min(1),page_route:_e.string().min(1).describe("\u4E3B\u7AD9\u76EE\u6807\u5FEB\u7167\u7684\u9875\u9762\u8DEF\u7531\uFF1A\u4F18\u5148 PAGE_SEO.path\uFF0C\u7F3A\u5931\u65F6\u7531\u6587\u4EF6\u8DEF\u7531\u63A8\u5BFC\uFF1B\u52A8\u6001\u9875\u4FDD\u7559\u8DEF\u7531\u6A21\u677F\uFF0C\u4E0D\u542B\u57DF\u540D\u6216\u5B50\u7AD9\u6302\u8F7D\u524D\u7F00\u3002"),page_title:_e.string().nullable().describe("\u4E3B\u7AD9\u76EE\u6807\u5FEB\u7167\u4E2D\u7684\u9759\u6001 PAGE_SEO.title\uFF1B\u7F3A\u5931\u6216\u52A8\u6001\u503C\u8FD4\u56DE null\uFF0C\u4E0D\u67E5\u8BE2 CMS \u6807\u9898\u8986\u76D6\u3002"),ai_image_count:_e.number().int().nonnegative().safe().describe("\u9875\u9762\u5F15\u7528\u7684\u5A92\u4F53\u6CE8\u518C\u8868 key \u6570\u91CF\uFF0C\u9875\u5185\u53BB\u91CD\uFF0C\u4E0D\u9650 12 \u5F20\uFF1B\u8868\u793A\u53EF\u4F9B AI \u91CD\u65B0\u751F\u6210\u7684\u5019\u9009\u56FE\u7247\u6570\u3002"),translation_character_count:_e.number().int().nonnegative().safe().describe("\u6574\u9875\u53EF\u9759\u6001\u63D0\u53D6\u7684\u6587\u6848\u53CA\u76F8\u5173\u56FE\u7247 alt\uFF0C\u539F\u6587\u53BB\u91CD\u540E\u7684 UTF-16 \u5B57\u7B26\u6570\uFF0C\u4E0D\u6263\u9664\u5386\u53F2\u8BD1\u6587\u3002")}),Ib={page_count:_e.number().int().nonnegative().safe().describe("\u65B0\u589E\u9875\u9762\u6570\u91CF\uFF0C\u7B49\u4E8E pending_pages \u957F\u5EA6\u3002"),ai_image_count:_e.number().int().nonnegative().safe().describe("\u9010\u9875\u5019\u9009\u56FE\u7247\u6570\u91CF\u4E4B\u548C\uFF0C\u8DE8\u9875\u4E0D\u53BB\u91CD\uFF0C\u4E0D\u8868\u793A\u5DF2\u7531 AI \u751F\u6210\u7684\u56FE\u7247\u6570\u3002"),translation_character_count:_e.number().int().nonnegative().safe().describe("\u9010\u9875\u9884\u4F30\u7FFB\u8BD1\u5B57\u7B26\u6570\u4E4B\u548C\uFF0C\u8DE8\u9875\u4E0D\u53BB\u91CD\uFF0C\u4E0D\u8868\u793A\u5B9E\u9645\u7FFB\u8BD1\u6D88\u8017\u3002"),page_estimates:_e.array(Rb)};function Tb(e,n){let s=new Set(e.pending_pages),i=new Set(e.page_estimates.map(a=>a.page_path));(s.size!==e.pending_pages.length||i.size!==e.page_estimates.length||s.size!==i.size||[...s].some(a=>!i.has(a)))&&n.addIssue({code:"custom",path:["page_estimates"],message:"page_estimates must correspond to pending_pages exactly once"});for(let[a,o]of[["page_count",e.pending_pages.length],["ai_image_count",e.page_estimates.reduce((c,r)=>c+r.ai_image_count,0)],["translation_character_count",e.page_estimates.reduce((c,r)=>c+r.translation_character_count,0)]])e[a]!==o&&n.addIssue({code:"custom",path:[a],message:"total must equal the sum of page estimates"})}var MO=_e.object({...Ib,subsite_site_id:_n,pending_pages:_e.array(_e.string().min(1)),hash_diverged_count:_e.number().int().nonnegative(),child_only_count:_e.number().int().nonnegative(),base_snapshot_id:_n,target_snapshot_id:_n}).superRefine(Tb),kb=_e.enum(["SUBSITE_DIFF_REQUEST_INVALID","SUBSITE_DIFF_STORE_NOT_CONFIGURED","SUBSITE_DIFF_MANIFEST_MISSING","SUBSITE_DIFF_MANIFEST_INVALID","SUBSITE_DIFF_ESTIMATE_INVALID"]),UO=_e.object({error_code:kb,message:_e.string().min(1),side:_e.enum(["base","target"]).optional()});import{z as ne}from"zod";var WO=ne.object({tenant_id:ne.string().min(1),site_id:k,snapshot_id:I,manifest_hash:ne.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:ne.string().min(1).max(2048),page_slug:ne.string().max(512).optional()}),BO=ne.object({site_id:k,snapshot_id:I,unit_count:ne.number().int().nonnegative(),file_count:ne.number().int().nonnegative(),markdown:ne.string().min(1),page_slug:ne.string().optional(),page_file:ne.string().optional(),entries:ne.array(ne.object({id:ne.string().min(1),file_path:ne.string().min(1),line:ne.number().int().nullable(),kind:ne.string().min(1),text:ne.string(),media_key:ne.string().optional()})).optional(),images:ne.array(ne.object({id:ne.string().min(1),source:ne.enum(["media-registry","source-literal"]),src:ne.string().min(1),alt:ne.string().nullable(),media_key:ne.string().optional(),width:ne.number().optional(),height:ne.number().optional(),provider:ne.string().optional(),is_placeholder:ne.boolean(),occurrences:ne.array(ne.object({file_path:ne.string().min(1),line:ne.number().int()}))})).optional()});import{z as Ab}from"zod";var wb=/^\/[a-z0-9][a-z0-9-]{0,30}$/,Pb=Object.freeze(["api","_next","assets","static","robots.txt","sitemap.xml",".well-known"]),Cb=new Set(Pb);function vb(e){return Cb.has(e)}var HO=Ab.string().regex(wb).refine(e=>!vb(e.slice(1)),{message:"mount_path must not use a reserved segment (api, _next, assets, static, robots.txt, sitemap.xml, .well-known)"});import{z as Se}from"zod";var Db=Se.enum(["active","paused","blocked"]),qm=Se.enum(["typecheck_failed","health_failed","validation_failed"]),Ob={status:Db,attempts:Se.number().int().nonnegative(),attempted_template_version:et.nullable(),last_error_code:qm.nullable()},gn=Se.object(Ob).strict(),ni=Se.object({template_id:Se.string().trim().min(1),target_template_version:et}).strict(),XO=ni,Nb=Se.discriminatedUnion("action",[Se.object({action:Se.literal("proceed"),state:gn.extend({status:Se.literal("active")})}).strict(),Se.object({action:Se.literal("skip_not_newer"),state:gn.extend({status:Se.literal("active")})}).strict(),Se.object({action:Se.literal("skip_paused"),state:gn.extend({status:Se.literal("paused")})}).strict(),Se.object({action:Se.literal("skip_blocked"),state:gn.extend({status:Se.literal("blocked")})}).strict()]),QO=ni,ZO=Nb,JO=ni.extend({error_code:qm}),eN=Se.object({state:gn}).strict(),tN=ni,nN=Se.object({state:gn}).strict();import{z as X}from"zod";var jb=744*60*60*1e3,Lb=X.enum(["eligible","fast_path","upgraded","skipped","lock_skipped","cas_aborted","validation_failed","blocked","paused"]),Mb=X.enum(["typecheck","build","health","validation"]),Ub=X.enum(["not_attempted","promoted","aborted"]),rN=X.object({template_id:X.string().trim().min(1).max(128),from_version:et.nullable(),to_version:et,outcome:Lb,attempt:X.number().int().nonnegative().max(2147483647),duration_ms:X.number().int().nonnegative().max(2147483647),replaced_group_count:X.number().int().nonnegative().max(2147483647),skipped_group_count:X.number().int().nonnegative().max(2147483647),validation_stage:Mb.nullable(),cas_outcome:Ub.nullable()}).strict(),cN=X.object({recorded:X.literal(!0)}).strict(),Wm=X.object({from:X.iso.datetime(),to:X.iso.datetime()}).strict().refine(({from:e,to:n})=>Date.parse(e)<Date.parse(n),{message:"from must be earlier than to",path:["to"]}).refine(({from:e,to:n})=>Date.parse(n)-Date.parse(e)<=jb,{message:"report window must not exceed 31 days",path:["to"]}),mN=Wm,Fb=X.object({eligible:X.number().int().nonnegative(),fast_path:X.number().int().nonnegative(),upgraded:X.number().int().nonnegative(),skipped:X.number().int().nonnegative(),lock_skipped:X.number().int().nonnegative(),cas_aborted:X.number().int().nonnegative(),validation_failed:X.number().int().nonnegative(),blocked:X.number().int().nonnegative(),paused:X.number().int().nonnegative()}).strict(),lN=X.object({window:Wm,outcome_counts:Fb,current_state_counts:X.object({blocked:X.number().int().nonnegative(),paused:X.number().int().nonnegative()}).strict(),duration_ms:X.object({p50:X.number().int().nonnegative().nullable(),p95:X.number().int().nonnegative().nullable(),sample_count:X.number().int().nonnegative()}).strict()}).strict(),pN=X.object({older_than:X.iso.datetime(),limit:X.coerce.number().int().min(1).max(200).default(50),include_candidates:X.enum(["true","false"]).default("false").transform(e=>e==="true")}).strict(),Gb=X.object({site_id:k,snapshot_id:I,status:X.enum(["candidate","deleting"]),created_at:X.iso.datetime()}).strict(),dN=X.object({snapshots:X.array(Gb)}).strict();import{z as xt}from"zod";var qb=xt.enum(["PREVIEW_SESSION_NOT_FOUND","PREVIEW_SESSION_INVALID","PREVIEW_SESSION_STALE","PREVIEW_SESSION_LOOKUP_FAILED","PREVIEW_SANDBOX_NOT_FOUND","PREVIEW_SANDBOX_CONNECT_FAILED","PREVIEW_SANDBOX_OWNERSHIP_MISMATCH","PREVIEW_ACTIVATION_TIMEOUT","PREVIEW_PREFLIGHT_FAILED","PREVIEW_ENV_LOOKUP_FAILED","PREVIEW_SERVER_START_FAILED","PREVIEW_HEALTH_CHECK_FAILED","SANDBOX_NOT_CONFIGURED"]),Wb=xt.object({status:xt.literal("ready"),preview_url:xt.string().url()}).strict(),Bb=xt.object({status:xt.literal("failed"),code:qb,message:xt.string().min(1),retryable:xt.boolean()}).strict(),gN=xt.discriminatedUnion("status",[Wb,Bb]);import{z as Dt}from"zod";var Kb=["not_started","active","completed"],zb=Dt.enum(Kb),Hb=["not_started","in_progress","completed"],$b=Dt.enum(Hb),Vb=Dt.object({sequence:Dt.number().int().positive(),code:At,status:$b}).strict(),Yb=Dt.object({site_id:k,workflow_status:zb,flow_type:cn.nullable(),current_step_code:At.nullable(),completed_count:Dt.number().int().nonnegative(),total_count:Dt.number().int().nonnegative(),steps:Dt.array(Vb)}).strict().superRefine((e,n)=>{let s=e.steps.filter(i=>i.status==="completed").length;e.total_count!==e.steps.length&&n.addIssue({code:"custom",path:["total_count"],message:"total_count must equal steps.length."}),e.completed_count!==s&&n.addIssue({code:"custom",path:["completed_count"],message:"completed_count must equal completed steps."}),e.steps.forEach((i,a)=>{i.sequence!==a+1&&n.addIssue({code:"custom",path:["steps",a,"sequence"],message:"Step sequence must be continuous and start at 1."})}),e.workflow_status==="not_started"&&(e.flow_type!==null&&n.addIssue({code:"custom",path:["flow_type"],message:"not_started progress cannot have a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"not_started progress cannot have a current step."}),(e.completed_count!==0||e.total_count!==0)&&n.addIssue({code:"custom",path:["steps"],message:"not_started progress must have zero counts and no steps."})),e.workflow_status==="active"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"active progress requires a flow_type."}),e.current_step_code===null&&n.addIssue({code:"custom",path:["current_step_code"],message:"active progress requires a current step."})),e.workflow_status==="completed"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"completed progress requires a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"completed progress cannot have a current step."}),e.steps.some(i=>i.status!=="completed")&&n.addIssue({code:"custom",path:["steps"],message:"completed progress must have only completed steps."}),e.completed_count!==e.total_count&&n.addIssue({code:"custom",path:["completed_count"],message:"completed progress counts must be equal."}))}),xN=U(Yb);import{z as Ha}from"zod";var Xb=Ha.enum(["none","build","build_publish"]),Qb=Ha.object({site_id:k,launcher_scope:Xb}),TN=Ha.object({permission:Qb});function kN(e){return e!=="none"}function AN(e){return e==="build_publish"}import{z as be}from"zod";var ON="build-context.json",NN=2e5,Bm=be.string().regex(/^sha256:[a-f0-9]{64}$/u),Km=1e3;function Zb(e){return Array.from(e).length<=Km}var Jb=be.object({kind:be.enum(["customer_materials","website_scan_diagnosis","committed_strategy"]),digest:Bm}).strict(),ey=be.object({schema_version:be.literal(1),flow_type:cn,sources:be.array(Jb).min(2).max(2)}).strict().superRefine((e,n)=>{let s=new Set(e.sources.map(a=>a.kind)),i=e.flow_type==="with_website"?["website_scan_diagnosis","committed_strategy"]:["customer_materials","committed_strategy"];(s.size!==i.length||i.some(a=>!s.has(a)))&&n.addIssue({code:"custom",path:["sources"],message:"Site-build provenance sources must match the persisted workflow flow."})}),ty=be.object({schema_version:be.literal(1),seed:Bm.optional(),cms_settings:be.object({main_products:be.string().trim().min(1).refine(Zb,{message:`main_products must contain at most ${Km} characters`}).optional()}).strict().optional(),provenance:ey.optional()}).strict(),ny=be.object({schema_version:be.literal(1),site_id:k,workflow_id:ot,brief:be.string().min(1),source:be.enum(["business_provider","mock"]),payload:ty}).strict().superRefine((e,n)=>{e.source==="business_provider"&&!e.payload.provenance&&n.addIssue({code:"custom",path:["payload","provenance"],message:"Business site-build context requires persisted provenance."})}),jN=be.object({source_snapshot_id:I,source_run_id:V,build_context:ny,page_slugs:be.array(be.string().min(1)).optional()}).strict(),LN=be.object({disposition:be.enum(["reused","rebased"]),snapshot_id:I}).strict(),sy=be.object({snapshot:ha,workspace_run_id:V.nullable()}).strict(),MN=U(sy);import{z as mt}from"zod";import{z as Ve}from"zod";import{z as De}from"zod";import{z as iy}from"zod";var ay=["brand","fact","cert","case","svc","faq","voice"],zm=iy.enum(ay);var oy=De.enum(["pending","running","ready","failed","missing"]),Jn=De.string().trim().min(1).max(255),BN=De.object({knowledge_site_id:Jn,source_ids:De.array(Jn).min(1).max(200)}).strict().superRefine((e,n)=>{new Set(e.source_ids).size!==e.source_ids.length&&n.addIssue({code:"custom",message:"Knowledge source IDs must be unique.",path:["source_ids"]})}),ry=De.object({source_file_id:Jn,category_code:zm.nullable(),category_confirmed:De.boolean(),status:oy}).strict(),KN=De.object({ready:De.boolean(),files:De.array(ry),counts:De.object({total:De.number().int().nonnegative(),pending:De.number().int().nonnegative(),running:De.number().int().nonnegative(),ready:De.number().int().nonnegative(),failed:De.number().int().nonnegative(),missing:De.number().int().nonnegative(),unclassified:De.number().int().nonnegative()}).strict()}).strict();var Ee=e=>Ve.string().trim().max(e),Hm=Ve.array(Ve.string().trim().min(1).max(120)).max(20),$a=Ve.object({company_name:Ve.string().trim().min(1).max(200),brand_name:Ee(200),primary_products:Ve.string().trim().min(1).max(1e3),industry:Ee(200),applications:Ee(1e3),business_summary:Ee(2e3),registered_capital:Ee(200).default(""),legal_representative:Ee(200).default(""),target_markets:Hm,customer_industries:Ee(1e3),customer_roles:Ee(1e3),buying_scenarios:Ee(2e3),differentiators:Ee(2e3),competitors:Ee(1e3),trust_proof:Ee(2e3),customer_cases:Ee(3e3),channels:Hm,expected_domain:Ee(255),brand_tone:Ee(500),contact_name:Ee(200),contact_info:Ee(500),timezone:Ee(100),launch_timing:Ee(200),input_source_ids:Ve.array(Jn).max(50)}).strict(),cy=Ve.enum(["draft","submitted"]),Va=$a.extend({id:Z,tenant_id:Ve.string().min(1),site_id:k,workflow_id:ot,status:cy,submitted_at:Ve.string().min(1).nullable(),created_at:Ve.string().min(1),updated_at:Ve.string().min(1)}).strict(),XN=U(Va),QN=U(Va),ZN=U(Va.nullable());var sj=Ws.extend({expected_current_node:mt.literal("website_scan"),type:mt.literal("existing_site"),result:Ws.shape.result.extend({website:mt.string().url(),scan_cards:mt.partialRecord(tm,Ia).refine(e=>Object.keys(e).length>0,{message:"At least one recognized scan card is required."})}).strict()}).strict(),ij=mt.object({expected_current_node:mt.literal("customer_materials"),materials:$a}).strict(),aj=mt.object({expected_current_node:mt.literal("diagnosis")}).strict(),oj=mt.object({expected_current_node:mt.literal("strategy")}).strict();import{z as j}from"zod";var Ya=["compact","comfortable","airy"],$m=["none","sm","md","lg","xl"],Vm="lg",Xa=["subtle","moderate","expressive"],my=[{id:"subtle",motionLevel:"subtle"},{id:"moderate",motionLevel:"moderate"},{id:"expressive",motionLevel:"expressive"}];function Ym(e){let n=my.find(s=>s.id===e);if(!n)throw new Error(`Unknown motion preset: ${e}`);return n}var Xm=["ocean","forest","clay","violet","graphite","crimson"],Qm=["ai-forest","ai-navy","ai-steel"],Zm=/^gen-[0-9a-f]{8}$/,Qa=[{id:"ai-forest",name:"\u5DE5\u4E1A\u58A8\u7EFF \xB7 Industrial Teal",description:"\u6C89\u7A33\u4E13\u4E1A\uFF0C\u7A81\u51FA\u7CBE\u5BC6\u4E0E\u53EF\u4FE1\u3002",fallbackReason:"\u7A33\u5B9A\u4E13\u4E1A\u7684\u9ED8\u8BA4\u9009\u62E9\u3002",colorSeeds:{primary:"#0E7C6F",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"sm"},{id:"ai-navy",name:"\u79D1\u6280\u6DF1\u84DD \xB7 Deep Tech Blue",description:"\u7406\u6027\u79D1\u6280\u611F\uFF0C\u5F3A\u8C03\u6280\u672F\u5B9E\u529B\u4E0E\u6570\u636E\u53EF\u4FE1\u3002",fallbackReason:"\u6280\u672F\u8868\u8FBE\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#1E3A8A",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"md"},{id:"ai-steel",name:"\u7CBE\u5BC6\u94F6\u7070 \xB7 Precision Steel",description:"\u514B\u5236\u6E05\u6670\uFF0C\u9002\u5408\u53C2\u6570\u4E0E\u5DE5\u7A0B\u7EC6\u8282\u8868\u8FBE\u3002",fallbackReason:"\u53C2\u6570\u4FE1\u606F\u8F83\u591A\u65F6\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#475569",accent:"#94A3B8",foreground:"#111827"},surfaceMode:"light",radius:"none"}],Za=[{id:"ocean",colorSeeds:{primary:"#1e3a5f",accent:"#2563eb",foreground:"#0f172a"},surfaceMode:"light",radius:"md"},{id:"forest",colorSeeds:{primary:"#14532d",accent:"#16a34a",foreground:"#0f172a"},surfaceMode:"light",radius:"lg"},{id:"clay",colorSeeds:{primary:"#7c2d12",accent:"#ea580c",foreground:"#1c1917"},surfaceMode:"light",radius:"xl"},{id:"violet",colorSeeds:{primary:"#3b0764",accent:"#7c3aed",foreground:"#18181b"},surfaceMode:"light",radius:"lg"},{id:"graphite",colorSeeds:{primary:"#1f2937",accent:"#0d9488",foreground:"#111827"},surfaceMode:"light",radius:"none"},{id:"crimson",colorSeeds:{primary:"#7f1d1d",accent:"#dc2626",foreground:"#1f1012"},surfaceMode:"light",radius:"sm"}];function mj(e){let n=Za.find(s=>s.id===e);if(!n)throw new Error(`Unknown theme preset: ${e}`);return n}function Jm(e){return Za.find(n=>n.id===e)?.radius??Qa.find(n=>n.id===e)?.radius}var Ja=j.string().regex(/^#[0-9A-F]{6}$/i),es=j.string().trim().min(1).max(500),el=j.string().datetime({offset:!0}),ly=j.enum(Xm),py=j.enum(Qm),dy=j.string().regex(Zm),ts=j.union([ly,py,dy]),ns=j.enum(va),ss=j.enum(Xa),is=j.enum(Ya),si=j.enum($m),tl=300,uy=j.string().trim().min(1).max(tl),ii=j.object({primary:Ja,accent:Ja,foreground:Ja}).strict(),_y=j.object({id:ts,rank:j.number().int().min(1).max(3),name:j.string().trim().min(1).max(120),description:j.string().trim().min(1).max(240),color_seeds:ii,surface_mode:j.enum(["light","dark"]),radius:si,font_pairing_id:ns,motion_preset_id:ss,density:is,weight_style:Ke.optional(),reason:es}).strict(),nl=j.object({name:j.string().trim().min(1).max(120),description:j.string().trim().min(1).max(240),reason:es,color_seeds:ii,surface_mode:j.enum(["light","dark"]),radius:si,font_pairing_id:ns,motion_preset_id:ss,density:is,weight_style:Ke}).strict(),sl=j.object({version:j.number().int().min(1),recommendation_id:j.string().uuid(),theme_preset_id:ts,color_seeds:ii,surface_mode:j.enum(["light","dark"]),font_pairing_id:ns,motion_preset_id:ss,density:is,radius:si.optional(),weight_style:Ke.optional(),aesthetic_note:uy.optional(),updated_at:el}).strict(),gy=j.object({id:j.string().uuid(),version:j.number().int().min(1),catalog_version:j.string().trim().min(1).max(80),source:j.object({mode:j.enum(["ai","fallback"]),fallback_reason:j.string().trim().min(1).max(80).nullable()}).strict(),inputs:j.object({industry:j.string().trim().min(1).max(160).optional(),site_language:j.string().trim().min(2).max(35),owner_locale:Te.optional(),strategy_version:j.number().int().min(1),input_digest:j.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict(),theme:j.object({recommended_id:ts,candidate_ids:j.array(ts).length(3),candidates:j.array(_y).length(3)}).strict().superRefine((e,n)=>{e.recommended_id!==e.candidate_ids[0]&&n.addIssue({code:"custom",path:["recommended_id"],message:"recommended_id must be the first candidate"}),e.candidates.some((s,i)=>s.id!==e.candidate_ids[i]||s.rank!==i+1)&&n.addIssue({code:"custom",path:["candidates"],message:"Candidates must follow candidate_ids order."})}),font:j.object({recommended_id:ns,reason:es}).strict(),motion:j.object({recommended_id:ss,reason:es}).strict(),density:j.object({recommended_id:is,reason:es}).strict(),conversion:Gt.optional(),generated_at:el}).strict(),yj=j.object({force_refresh:j.boolean().optional()}).strict(),xj=j.object({request_id:j.string().trim().min(1).max(160),site_id:k,cached:j.boolean(),recommendation:gy,selection:sl}).strict(),Ej=j.object({recommendation_id:j.string().uuid(),expected_version:j.number().int().min(1),theme_preset_id:ts,color_seeds:ii,surface_mode:j.enum(["light","dark"]),font_pairing_id:ns,motion_preset_id:ss,density:is,radius:si.optional(),weight_style:Ke.optional(),aesthetic_note:j.string().trim().max(tl).optional()}).strict(),Rj=j.object({selection:sl}).strict(),hy=4e3,Ij=j.object({tenant_id:j.string().trim().min(1).max(160),site_id:k,site_language:j.string().trim().min(2).max(35),owner_locale:Te,industry:j.string().trim().min(1).max(160).optional(),strategy_version_id:j.string().uuid(),strategy_version:j.number().int().min(1),strategy_checksum:j.string().regex(/^[a-f0-9]{64}$/),strategy_summary:j.array(j.string().trim().min(1).max(hy)).min(1).max(je)}).strict(),eo=j.object({theme_candidates:j.array(nl).length(3),conversion:Gt.optional()}).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,a)=>{let o=JSON.stringify(i.color_seeds).toUpperCase();s.has(o)&&n.addIssue({code:"custom",path:["theme_candidates",a,"color_seeds"],message:"Theme candidates must have pairwise distinct color_seeds"}),s.add(o)})});function Tj(){return Qa.map(e=>nl.parse({name:e.name,description:e.description,reason:e.fallbackReason,color_seeds:e.colorSeeds,surface_mode:e.surfaceMode,radius:e.radius,font_pairing_id:va[0],motion_preset_id:Xa[0],density:Ya[1],weight_style:Ks}))}function Sy(e){return e.radius??Jm(e.theme_preset_id)??"lg"}function fy(e,n){return e.weight_style??n?.theme?.candidates?.find(s=>s.id===e.theme_preset_id)?.weight_style??n?.theme?.candidates?.[0]?.weight_style??Ks}function kj(e,n){let s=um(e.font_pairing_id),i=Ym(e.motion_preset_id);return{colorSeeds:e.color_seeds,surfaceMode:e.surface_mode,fonts:{heading:s.heading,body:s.body},density:e.density,motionLevel:i.motionLevel,motionPreset:i.id,radius:Sy(e),weightStyle:fy(e,n)}}function Aj(e,n){let s=e.theme.candidates[0];return{version:1,recommendation_id:e.id,theme_preset_id:s.id,color_seeds:s.color_seeds,surface_mode:s.surface_mode,font_pairing_id:e.font.recommended_id,motion_preset_id:e.motion.recommended_id,density:e.density.recommended_id,radius:s.radius,weight_style:s.weight_style,updated_at:n.toISOString()}}import{z as to}from"zod";function by(e){return JSON.stringify([e.color_seeds.primary.toUpperCase(),e.color_seeds.accent.toUpperCase(),e.color_seeds.foreground.toUpperCase(),e.surface_mode,e.font_pairing_id,e.radius,e.motion_preset_id,e.density,e.weight_style])}var yy=to.object(eo.shape).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,a)=>{let o=by(i);s.has(o)&&n.addIssue({code:"custom",path:["theme_candidates",a],message:"Theme candidates must have pairwise distinct visual identities"}),s.add(o)})}),vj=to.union([eo,yy.safeExtend({model_profile:to.literal("azure-gpt")})]);import{z as Ot}from"zod";var jj=Ot.object({site_id:k,site_language:Ot.string().trim().min(2).max(35),business_facts:Ot.array(Ot.string().trim().min(1).max(1e3)).min(1).max(8)}).strict(),xy=Ot.enum(["high","medium","low"]),Lj=Ot.object({skill_name:Ot.string().trim().min(1).max(80).nullable(),confidence:xy,reason:Ot.string().trim().min(1).max(240)}).strict();import{z as as}from"zod";var il=1e4,Ey=as.object({note:as.string().trim().max(il),updated_at:as.string().min(1)}).strict(),Gj=as.object({note:as.string().trim().max(il)}).strict(),qj=U(Ey.nullable());import{z as ae}from"zod";var no=["title","text","richtext","number","boolean","date","datetime","url","email","color","select","multiselect","tag"],ai=ae.object({name:ae.string().min(1).max(100),type:ae.enum(no),label:ae.string().min(1).max(255),required:ae.boolean().optional(),options:ae.array(ae.string()).optional()}),Kj=ae.object({name:ae.string(),cms_type:ae.string(),label:ae.string().optional(),required:ae.boolean().optional(),value_shape:ae.string().optional(),front_display:ae.enum(["visible","internal","forbidden"]).optional(),choices:ae.array(ae.object({value:ae.union([ae.string(),ae.number()]),label:ae.string()})).optional()}),zj=ae.object({route_file_path:ae.string().min(1),target_component_path:ae.string().min(1),content_type_hint:ae.string().min(1),collection_purpose:ae.enum(["generic","product"]).optional(),required_fields:ae.array(ai).optional(),mode:ae.enum(["bind_existing","provision"]),list_mode:ae.enum(["page","embedded"]).optional(),fields:ae.array(ai).optional(),seed_records:ae.array(ae.record(ae.string(),ae.unknown())).optional()});import{z as q}from"zod";var os=q.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),oi=q.string().regex(/^[a-f0-9]{64}$/),ri=q.string().regex(/^[a-z][a-z0-9-]{0,99}$/),ci=q.string().regex(/^[a-z0-9]{1,30}$/),Xe=e=>q.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),al=q.object({id:q.string().uuid(),key:Xe(100),name:Xe(255)}).strict(),rl=new Set(["title","summary","description","category","thumbnail","url","admin_id"]),Ry=new Set(["title","summary","description","image_query"]),Iy=new Set(["category","thumbnail","url","admin_id","page","pages","route","path","component","components","snapshot","run","site_id","cms_site_id","tenant_id","token","secret","password","authorization","headers","__proto__","prototype","constructor"]),ol=new Set(["select","multiselect"]),Ty=new Set(["title","text","richtext","date","datetime","url","email","color"]),ky=q.object({name:Xe(100),label:Xe(255),type:q.enum(no),required:q.boolean().optional(),options:q.array(Xe(100)).max(100).optional()}).strict().superRefine((e,n)=>{let s=e.options??[];ol.has(e.type)&&s.length===0&&n.addIssue({code:"custom",path:["options"],message:"Choice fields require at least one option"}),!ol.has(e.type)&&s.length>0&&n.addIssue({code:"custom",path:["options"],message:"Only choice fields may declare options"}),new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["options"],message:"Field options must be unique"}),rl.has(e.name)&&n.addIssue({code:"custom",path:["name"],message:"Reserved CMS field names cannot be declared"})}),Ay=q.array(ky).min(1).max(200),wy=q.array(q.record(q.string(),q.unknown())).max(1e3);function Ye(e,n,s){e.addIssue({code:"custom",path:n,message:s})}var Py=q.object({name:Xe(30),slug:ci,collection_purpose:q.enum(["generic","product"]).optional(),fields:Ay,seed_records:wy}).strict().superRefine((e,n)=>{let s=e.fields.map(a=>a.name);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["fields"],message:"Field names must be unique"}),s.some(a=>!rl.has(a))||n.addIssue({code:"custom",path:["fields"],message:"At least one custom field is required"});let i=new Map(e.fields.map(a=>[a.name,a]));e.seed_records.forEach((a,o)=>{for(let[c,r]of Object.entries(a)){let m=["seed_records",o,c];if(Iy.has(c)){Ye(n,m,"Seed cannot write reserved or runtime-owned fields");continue}if(c==="image_query"){(typeof r!="string"||r.trim()==="")&&Ye(n,m,"image_query must be a non-empty string");continue}if(Ry.has(c)){typeof r!="string"&&Ye(n,m,"Seed skeleton text fields must be strings");continue}let x=i.get(c);if(!x){Ye(n,m,"Seed contains an undeclared field");continue}if(r==null){Ye(n,m,"Seed field values must not be null");continue}if(x.type==="select")(typeof r!="string"||!(x.options??[]).includes(r))&&Ye(n,m,"Seed select value must be one of the declared options");else if(x.type==="multiselect")(!Array.isArray(r)||r.length===0||r.some(_=>typeof _!="string"||!(x.options??[]).includes(_)))&&Ye(n,m,"Seed multiselect value must contain only declared options");else if(x.type==="number")(typeof r!="number"||!Number.isFinite(r))&&Ye(n,m,"Seed number values must be finite numbers");else if(x.type==="boolean")typeof r!="boolean"&&Ye(n,m,"Seed boolean values must be booleans");else if(x.type==="tag"){let _=Array.isArray(r)?r:[r];(_.length===0||_.some(P=>typeof P!="string"||P.trim()===""))&&Ye(n,m,"Seed tag values must be non-empty strings")}else Ty.has(x.type)&&typeof r!="string"&&Ye(n,m,"Seed text-like values must be strings")}for(let c of e.fields)c.required&&!(c.name in a)&&Ye(n,["seed_records",o,c.name],"Required fields must be present in every seed record")}),new TextEncoder().encode(JSON.stringify(e)).byteLength>1024*1024&&n.addIssue({code:"custom",path:[],message:"Application template must not exceed 1048576 UTF-8 bytes"})}),so=q.object({schema_version:q.literal(1),application:Py}).strict(),Cy=q.object({templateId:q.string().uuid(),stableKey:ri,resolvedVersion:os,digest:oi,template:so}).strict(),vy=Cy,Dy={alreadyCreated:"APPLICATION_ALREADY_CREATED",slugConflict:"APPLICATION_SLUG_CONFLICT",createInProgress:"APPLICATION_CREATE_IN_PROGRESS",cmsUnbound:"APPLICATION_CMS_UNBOUND",templateVersionUnavailable:"APPLICATION_TEMPLATE_VERSION_UNAVAILABLE",createFailed:"APPLICATION_CREATE_FAILED",createResultUnknown:"APPLICATION_CREATE_RESULT_UNKNOWN"},cl=q.enum(Object.values(Dy)),ml=q.object({category_status:q.enum(["succeeded","failed","not_attempted"]),seed_status:q.enum(["skipped","succeeded","partial","failed"]),requested_count:q.number().int().nonnegative(),written_count:q.number().int().nonnegative().nullable(),published_count:q.number().int().nonnegative().nullable(),errors:q.array(q.object({stage:q.enum(["category","seed","receipt"]),code:Xe(100)}).strict()).max(20)}).strict(),Oy=q.object({templateId:q.string().uuid(),stableKey:ri,title:Xe(200),description:q.string().max(1e3),thumbnailUrl:q.string().url().nullable(),resolvedVersion:os,digest:oi,application:q.object({name:Xe(30),slug:ci}).strict(),categories:q.array(al),tags:q.array(al),status:q.enum(["available","creating","created","conflict","failed"]),errorCode:cl.nullable().optional(),template:so.optional()}).strict(),ll=q.object({items:q.array(Oy)}).strict(),Yj=q.object({version:os}).strict(),Ny=q.object({app_slug:ci,name:Xe(30),template:q.object({stable_key:ri,version:os,digest:oi}).strict()}).strict(),jy=q.object({status:q.literal("created"),application:Ny,initialization:ml}).strict(),Xj=jy,Ly=q.object({stable_key:ri,version:os,digest:oi,created_at:q.string().datetime().nullable(),initialization:ml.nullable()}).strict(),My=q.object({app_slug:ci,name:Xe(30),collection_slug:q.string().min(1),detail_prefix:q.string().min(1).optional(),source:Ly.nullable()}).strict(),Qj=q.object({applications:q.array(My)}).strict(),Zj=ll,Jj=q.object({code:cl,message:Xe(500)}).strict(),eL=so,tL=vy,nL=ll;import{z as ge}from"zod";var pl=e=>ge.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),Uy=ai.strict(),ul=ge.array(Uy).min(1).max(200),Fy=ge.array(ge.record(ge.string(),ge.unknown())).max(1e3),Gy=ge.string().regex(/^[a-z0-9]{1,30}$/),io=ge.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),oL=ge.object({name:pl(30),slug:pl(50),collection_purpose:ge.enum(["generic","product"]).optional(),fields:ul}).strict(),dl=ge.object({collection_slug:Gy,detail_prefix:ge.string().min(1).max(255),plugin_id:io.optional()}).strict(),rL=ge.discriminatedUnion("kind",[dl.extend({kind:ge.literal("created")}),dl.extend({kind:ge.literal("exists")})]),cL=ge.object({fields:ul,seed_records:Fy,category_id:io}).strict(),qy=ge.record(ge.string().min(1),ge.string().min(1).nullable()),mL=ge.object({ids:ge.array(io).max(1e3),urls:qy,failed:ge.array(ge.unknown()).max(1e3)}).strict();function lL(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,30)}import{z as Re}from"zod";import{z as ao}from"zod";var _l=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],gl="-",Wy="embedded",oo=ao.enum([..._l,gl]),By=ao.literal(Wy),ro=ao.object({scene:oo,shape:By}).strict();function uL(e){return _l.find(n=>n===e)??gl}var mi=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number","file"],Ky=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number"],zy=Re.object({name:Re.string().min(1).max(100),type:Re.enum(Ky),label:Re.string().min(1).max(255),required:Re.boolean().optional(),options:Re.array(Re.string()).optional()}),Hy=Re.string().regex(/^[a-z][a-z0-9-]{0,48}$/).optional(),SL=Re.object({mode:Re.enum(["bind_existing","provision"],{error:'mode is required. Use "bind_existing" or "provision". Never call connect_form with {}.'}),form_hint:Re.string().min(1).optional(),name:Re.string().min(1).max(255).optional(),scene:oo.optional(),component_slug:Hy,description:Re.string().min(1).max(1e3).optional(),fields:Re.array(zy).optional()}).superRefine((e,n)=>{e.mode==="provision"&&e.scene===void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is required for provision"}),e.mode==="bind_existing"&&e.scene!==void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is prohibited for bind_existing"}),e.mode==="bind_existing"&&!e.form_hint?.trim()&&n.addIssue({code:"custom",path:["form_hint"],message:"form_hint is required for bind_existing"}),e.mode==="provision"&&!e.name?.trim()&&n.addIssue({code:"custom",path:["name"],message:"name is required for provision"})}),fL=Re.object({name:Re.string(),label:Re.string(),cms_type:Re.string(),required:Re.boolean()});import{z as d}from"zod";var rs=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,Sn=/^[A-Za-z][A-Za-z0-9_-]{0,127}$/,li=/^[A-Za-z][A-Za-z0-9_]{0,99}$/,bl=/^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/,mo=/^[a-z][a-z0-9-]{0,99}$/,yl=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/,hl=2,Sl=3,pi=d.string().regex(rs),$y=d.string().regex(rs),lo=d.string().regex(rs),cs=d.string().regex(li),po=d.string().regex(bl),Vy=d.discriminatedUnion("status",[d.object({status:d.literal("unbound"),form_code:d.null()}).strict(),d.object({status:d.literal("bound"),form_code:d.string().regex(Sn)}).strict(),d.object({status:d.literal("missing"),form_code:d.string().regex(Sn)}).strict()]),Yy=d.object({value:po,label:d.string().trim().min(1).max(255)}).strict(),Xy=d.object({kind:d.literal("field"),field_name:cs,type:d.enum(mi),label:d.string().trim().min(1).max(255),required:d.boolean(),span:d.enum(["full","half"]),options:d.array(Yy).max(100),max_files:d.number().int().min(1).max(5).optional()}).strict(),Qy=d.object({kind:d.literal("step-break"),step_id:d.string().regex(rs)}).strict(),Zy=d.discriminatedUnion("kind",[Xy,Qy]),Jy=d.object({field_name:cs,type:d.enum(mi),last_label:d.string().max(255)}).strict(),ex=d.object({field_name:cs,value:po,last_label:d.string().max(255)}).strict(),tx=d.discriminatedUnion("kind",[d.object({kind:d.literal("custom")}).strict(),d.object({kind:d.literal("template"),slug:d.string().regex(mo),version:d.string().regex(yl)}).strict()]),nx={select:2,radio:2,multiselect:1,DropdownSelection:2,RadioButton:2,Checkbox:1};function lt(e){return e.toLowerCase()}function xl(e,n){return e.trim().toLocaleLowerCase(n)}function hn(e,n){return`${lt(e)}\0${n}`}function Ae(e,n,s,i){let a=new Set;for(let o of e){if(a.has(o)){i.addIssue({code:"custom",path:n,message:s});return}a.add(o)}}function uo(e,n,s,i){let a=nx[e]??0;a>0&&n<a?i.addIssue({code:"custom",path:s,message:`choice field requires at least ${a} option${a===1?"":"s"}`}):a===0&&n>0&&i.addIssue({code:"custom",path:s,message:"non-choice fields must use an empty options array"})}var _o=d.object({schema_version:d.literal(1),min_runtime_version:d.number().int().positive(),form_definition_id:pi,binding:Vy,content_locale:Te,features:d.object({multistep:d.boolean()}).strict(),copy:d.object({title:d.string().max(255),description:d.string().max(1e3),submit_button:d.string().trim().min(1).max(100),success_message:d.string().trim().min(1).max(500),error_message:d.string().max(500)}).strict(),layout:d.object({columns:d.enum(["one","two"])}).strict(),nodes:d.array(Zy).min(1).max(200),source:tx,retired:d.object({fields:d.array(Jy).max(1e3),options:d.array(ex).max(5e3)}).strict(),compatibility:d.object({standardization_version:d.number().int().positive(),diagnostics:d.array(d.string().trim().min(1).max(500)).max(100)}).strict()}).strict().superRefine((e,n)=>{let s=e.nodes.flatMap((r,m)=>r.kind==="field"?[[m,r]]:[]),i=s.map(([,r])=>r);i.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"at least one field node is required"});let a=e.nodes.filter(r=>r.kind==="step-break");!e.features.multistep&&a.length>0&&n.addIssue({code:"custom",path:["nodes"],message:"step-break requires the multistep feature"}),e.features.multistep&&(e.min_runtime_version<hl&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`multistep requires runtime version ${hl}`}),a.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"multistep requires at least one step-break"}));for(let[r,m]of e.nodes.entries())m.kind==="step-break"&&(r===0||r===e.nodes.length-1||e.nodes[r-1]?.kind==="step-break"||e.nodes[r+1]?.kind==="step-break")&&n.addIssue({code:"custom",path:["nodes",r],message:"step-break must separate two non-empty steps"});Ae(a.map(r=>r.step_id),["nodes"],"step_id must be unique",n),Ae(i.map(r=>lt(r.field_name)),["nodes"],"field_name must be unique",n),Ae(e.retired.fields.map(r=>lt(r.field_name)),["retired","fields"],"retired field_name must be unique",n);let o=new Set(e.retired.fields.map(r=>lt(r.field_name)));for(let[r,m]of s)o.has(lt(m.field_name))&&n.addIssue({code:"custom",path:["nodes",r,"field_name"],message:"retired field_name cannot be reused"}),uo(m.type,m.options.length,["nodes",r,"options"],n),m.type==="file"?e.min_runtime_version<Sl&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`file fields require runtime version ${Sl}`}):m.max_files!==void 0&&n.addIssue({code:"custom",path:["nodes",r,"max_files"],message:"max_files is only valid for file fields"}),Ae(m.options.map(x=>x.value),["nodes",r,"options"],"option value must be unique within a field",n),Ae(m.options.map(x=>xl(x.label,e.content_locale)),["nodes",r,"options"],"option label must be unique within a field",n);Ae(e.retired.options.map(r=>hn(r.field_name,r.value)),["retired","options"],"retired option identity must be unique",n);let c=new Set(e.retired.options.map(r=>hn(r.field_name,r.value)));for(let[r,m]of s)for(let[x,_]of m.options.entries())c.has(hn(m.field_name,_.value))&&n.addIssue({code:"custom",path:["nodes",r,"options",x,"value"],message:"retired option value cannot be reused"})}),sx=["copy.title","copy.description","copy.submit_button","copy.success_message","copy.error_message","nodes.*.label","nodes.*.options.*.label"],ix=new Set(sx);function kL(e){let n=e.map(s=>typeof s=="number"||/^\d+$/.test(s)?"*":s).join(".");return ix.has(n)}function AL(e,n){let s=[],i=e.nodes.filter(r=>r.kind==="field"),a=new Map(n.nodes.filter(r=>r.kind==="field").map(r=>[lt(r.field_name),r])),o=new Map(n.retired.fields.map(r=>[lt(r.field_name),r])),c=new Map(n.retired.options.map(r=>[hn(r.field_name,r.value),r]));for(let r of i){let m=lt(r.field_name),x=a.get(m),_=o.get(m);x&&x.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),x&&x.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!x&&_&&_.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!x&&_&&_.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!x&&!o.has(m)&&s.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name});let P=new Set(x?.options.map(K=>K.value)??[]);for(let K of r.options){let H=c.get(hn(r.field_name,K.value));!P.has(K.value)&&H&&H.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!P.has(K.value)&&!H&&s.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:K.value})}}for(let r of e.retired.fields){let m=o.get(lt(r.field_name));m&&m.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m&&m.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),m||s.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name})}for(let r of e.retired.options){let m=c.get(hn(r.field_name,r.value));m&&m.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m||s.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:r.value})}return s}var ax=d.enum(Nn),Nt=d.object({english:d.string().max(1e3),translations:d.partialRecord(ax,d.string().max(1e3)).optional()}).strict(),ox=d.object({template_option_key:d.string().regex(bl),label:Nt}).strict(),rx=d.object({template_field_key:d.string().regex(li),type:d.enum(mi),label:Nt,required:d.boolean(),span:d.enum(["full","half"]),options:d.array(ox).max(100)}).strict(),cx=d.object({template_step_key:d.string().regex(li),after_field_key:d.string().regex(li)}).strict(),wL=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],PL=[1,1,1,1,1,1],El=d.string().regex(mo),mx=d.object({schema_version:d.literal(1),slug:El,template_slugs:d.array(d.string().regex(/^[a-z][a-z0-9-]{0,99}$/)).max(500).optional(),name:Nt,template_count:d.number().int().min(0).max(500)}).strict().superRefine((e,n)=>{e.name.english.trim()===""&&n.addIssue({code:"custom",path:["name","english"],message:"English category name is required"})}),lx=d.object({schema_version:d.literal(1),slug:d.string().regex(mo),version:d.string().regex(yl),category:El,copy:d.object({title:Nt,description:Nt,submit_button:Nt,success_message:Nt,error_message:Nt}).strict(),layout:d.object({columns:d.enum(["one","two"])}).strict(),fields:d.array(rx).min(1).max(200),step_breaks:d.array(cx).max(20).optional()}).strict().superRefine((e,n)=>{for(let o of["title","description","submit_button","success_message","error_message"])e.copy[o].english.trim()===""&&n.addIssue({code:"custom",path:["copy",o,"english"],message:"English baseline text is required"});Ae(e.fields.map(o=>o.template_field_key),["fields"],"template_field_key must be unique",n);let s=new Map(e.fields.map((o,c)=>[o.template_field_key,c])),i=e.step_breaks??[];Ae(i.map(o=>o.template_step_key),["step_breaks"],"template_step_key must be unique",n),Ae(i.map(o=>o.after_field_key),["step_breaks"],"step breaks must not share an anchor field",n);let a=-1;for(let[o,c]of i.entries()){let r=s.get(c.after_field_key);r===void 0||r>=e.fields.length-1?n.addIssue({code:"custom",path:["step_breaks",o,"after_field_key"],message:"step break must follow an existing non-final field"}):r<=a&&n.addIssue({code:"custom",path:["step_breaks",o,"after_field_key"],message:"step breaks must follow field order"}),a=r??a}e.fields.length+i.length>200&&n.addIssue({code:"custom",path:["step_breaks"],message:"template fields and step breaks must not exceed 200 nodes"});for(let[o,c]of e.fields.entries()){c.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",o,"label","english"],message:"English field label is required"}),uo(c.type,c.options.length,["fields",o,"options"],n),Ae(c.options.map(r=>r.template_option_key),["fields",o,"options"],"template_option_key must be unique within a field",n),Ae(c.options.map(r=>r.label.english.trim().toLowerCase()),["fields",o,"options"],"English option labels must be unique within a field",n);for(let[r,m]of c.options.entries())m.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",o,"options",r,"label","english"],message:"English option label is required"})}}),CL=d.object({schema_version:d.literal(1),visibility:d.enum(["internal","public"]),categories:d.array(mx).max(500),templates:d.array(lx).max(500)}).strict().superRefine((e,n)=>{let s=(a,o)=>{let c=Nn.filter(r=>!a.translations?.[r]?.trim());c.length>0&&n.addIssue({code:"custom",path:[...o,"translations"],message:`public template copy is missing locales: ${c.join(", ")}`})};Ae(e.categories.map(a=>a.slug),["categories"],"template category slug must be unique",n);let i=new Set(e.categories.map(a=>a.slug));for(let[a,o]of e.categories.entries()){let c=e.templates.filter(r=>o.template_slugs?o.template_slugs.includes(r.slug):r.category===o.slug).length;o.template_count!==c&&n.addIssue({code:"custom",path:["categories",a,"template_count"],message:"template_count must match catalog templates"})}Ae(e.templates.map(a=>a.slug),["templates"],"template slug must be unique",n);for(let[a,o]of e.templates.entries())(e.categories.some(r=>r.template_slugs!==void 0)?!e.categories.some(r=>r.template_slugs?.includes(o.slug)):!i.has(o.category))&&n.addIssue({code:"custom",path:["templates",a,"category"],message:"template category must exist in catalog categories"});for(let[a,o]of e.categories.entries())if(o.template_slugs){Ae(o.template_slugs,["categories",a,"template_slugs"],"template membership must be unique",n);for(let c of o.template_slugs)e.templates.some(r=>r.slug===c)||n.addIssue({code:"custom",path:["categories",a,"template_slugs"],message:"template membership must exist in catalog templates"})}if(e.visibility==="public"){for(let[a,o]of e.categories.entries())s(o.name,["categories",a,"name"]);for(let[a,o]of e.templates.entries()){for(let[c,r]of Object.entries(o.copy))s(r,["templates",a,"copy",c]);for(let[c,r]of o.fields.entries()){s(r.label,["templates",a,"fields",c,"label"]);for(let[m,x]of r.options.entries())s(x.label,["templates",a,"fields",c,"options",m,"label"])}}}});function vL(e,n){let s=Dr(n),i=s?e.translations?.[s]:void 0;return i!==void 0&&i.trim()!==""?i:e.english}var px=["Text","Summary","Email","Phone","DropdownSelection","RadioButton","Checkbox","Boolean","Date","Num","MultipleFile","SpecificFile"],dx={text:"Text",textarea:"Summary",email:"Email",phone:"Phone",select:"DropdownSelection",radio:"RadioButton",multiselect:"Checkbox",boolean:"Boolean",date:"Date",number:"Num",file:"MultipleFile"},ux=d.object({value:po,label:d.string().trim().min(1).max(255)}).strict(),_x=d.object({field_name:cs,field_type:d.enum(px),field_label:d.string().trim().min(1).max(255),is_required:d.boolean(),sort_order:d.number().int().nonnegative(),options:d.array(ux).max(100)}).strict(),Rl=d.object({version:d.literal(1),locale:Te,fields:d.array(_x).min(1).max(200)}).strict().superRefine((e,n)=>{Ae(e.fields.map(s=>lt(s.field_name)),["fields"],"field_name must be unique",n);for(let[s,i]of e.fields.entries())uo(i.field_type,i.options.length,["fields",s,"options"],n),Ae(i.options.map(a=>a.value),["fields",s,"options"],"option value must be unique within a field",n),Ae(i.options.map(a=>xl(a.label,e.locale)),["fields",s,"options"],"option label must be unique within a field",n)});function DL(e){let n=e.nodes.filter(s=>s.kind==="field").map((s,i)=>({field_name:s.field_name,field_type:s.type==="file"&&s.max_files===1?"SpecificFile":dx[s.type],field_label:s.label,is_required:s.required,sort_order:i,options:s.options.map(a=>({...a}))}));return Rl.parse({version:1,locale:e.content_locale,fields:n})}function OL(e){return{form_display:{columns:e.layout.columns},fields:e.nodes.filter(n=>n.kind==="field").map(n=>({field_name:n.field_name,span:n.span}))}}function NL(e,n){if(e.binding.form_code!==null&&e.binding.form_code!==n.form.form_code)return e;let s=new Map(n.fields.map(i=>[i.field_name,i.span]));return{...e,layout:{columns:n.form.config_basic?.form_display?.columns??e.layout.columns},nodes:e.nodes.map(i=>i.kind==="field"?{...i,span:s.get(i.field_name)??i.span}:i)}}var ue=d.string().regex(/^sha256:[0-9a-f]{64}$/),gx=d.union([Ie,d.enum(["app/api/forms/[code]/route.ts","hooks/use-cms-form-submit.ts","lib/cms/forms.ts","lib/cms/client.ts"])]),hx=d.object({path:gx,content_hash:ue.nullable()}).strict(),Sx=d.array(hx).min(1).max(500).superRefine((e,n)=>{Ae(e.map(s=>s.path),[],"affected file paths must be unique",n)}),go=d.object({grade:d.enum(["standard","A","B","C"]),required:d.boolean(),pending_confirmations:d.array(d.object({item_id:d.string().regex(rs),field_name:cs.optional(),kind:d.enum(["form_copy","layout","field_label","field_type","field_required","field_options"]),message:d.string().trim().min(1).max(500)}).strict().superRefine((e,n)=>{e.kind.startsWith("field_")&&!e.field_name&&n.addIssue({code:"custom",path:["field_name"],message:"field confirmation items require field_name"})})).max(200)}).strict().superRefine((e,n)=>{let s=e.grade==="standard";s===e.required&&n.addIssue({code:"custom",path:["required"],message:s?"standard forms do not require standardization confirmation":"legacy forms require standardization confirmation"}),e.grade==="C"&&e.pending_confirmations.length===0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"grade C requires at least one pending confirmation"}),e.grade!=="C"&&e.pending_confirmations.length>0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"only grade C can contain pending confirmations"})}),fx=d.object({site_id:k,form_definition_id:pi,base_snapshot_id:I,expected_form_spec_hash:ue,expected_cms_schema_hash:ue.nullable(),form_metadata:ro.nullable(),draft_form_spec_hash:ue,desired_cms_schema_hash:ue,affected_files_hash:ue,shared_reference_hash:ue,shared_reference_count:d.number().int().positive(),confirm_shared_update:d.boolean(),recreate_missing_binding:d.boolean(),standardization:go,confirm_standardization:d.boolean()}).strict(),Il=d.object({reference_hash:ue,page_count:d.number().int().positive(),block_count:d.number().int().positive()}).strict().refine(e=>e.page_count<=e.block_count,{message:"page_count cannot exceed block_count"}),jL=d.object({site_id:k,form_block_id:$y,base_snapshot_id:I,form_spec:_o,runtime_upgrade_required:d.boolean(),expected_form_spec_hash:ue,expected_cms_schema_hash:ue.nullable(),affected_files_hash:ue,shared_impact:Il,standardization:go}).strict(),bx=d.object({operation_id:lo,operation_fingerprint:ue,site_id:k,form_definition_id:pi,base_snapshot_id:I,expected_form_spec_hash:ue,expected_cms_schema_hash:ue.nullable(),form_metadata:ro.nullable(),draft_form_spec:_o,draft_form_spec_hash:ue,desired_cms_schema_hash:ue,affected_files_hash:ue,shared_impact:Il,confirm_shared_update:d.boolean(),recreate_missing_binding:d.boolean(),standardization:go,confirm_standardization:d.boolean()}).strict().superRefine((e,n)=>{e.form_definition_id!==e.draft_form_spec.form_definition_id&&n.addIssue({code:"custom",path:["form_definition_id"],message:"form_definition_id must match draft_form_spec"}),e.shared_impact.block_count>1&&!e.confirm_shared_update&&n.addIssue({code:"custom",path:["confirm_shared_update"],message:"shared definition updates require explicit confirmation"});let s=e.draft_form_spec.binding.status==="missing";s!==e.recreate_missing_binding&&n.addIssue({code:"custom",path:["recreate_missing_binding"],message:s?"missing bindings require explicit recreation confirmation":"only missing bindings can be recreated"});let i=e.draft_form_spec.binding.status==="bound",a=i&&e.standardization.required&&(e.standardization.grade==="B"||e.standardization.grade==="C");(i&&!a&&e.expected_cms_schema_hash===null||!i&&e.expected_cms_schema_hash!==null)&&n.addIssue({code:"custom",path:["expected_cms_schema_hash"],message:i?"bound standard forms require the current CMS schema hash":"unbound or missing forms cannot claim a current CMS schema hash"}),e.confirm_standardization!==e.standardization.required&&n.addIssue({code:"custom",path:["confirm_standardization"],message:e.standardization.required?"legacy standardization requires explicit confirmation":"standard forms cannot claim legacy standardization confirmation"})}),yx=["created","validated","binding_reserved","candidate_ready","cms_applied","snapshot_promoted","committed","compensating","recovery_required","failed"],ho=d.enum(yx),xx=["pending","running","succeeded","failed","recovery_required"],Tl=d.enum(xx),Ex=["candidate_abandon","snapshot_reconcile","cms_restore"],kl=d.enum(Ex),Rx=["FORM_DESIGN_INVALID","FORM_DESIGN_UNSUPPORTED","FORM_DESIGN_STANDARDIZATION_AGENT_REQUIRED","FORM_DESIGN_STANDARDIZATION_UNSUPPORTED","FORM_DESIGN_FEATURE_NOT_ENABLED","FORM_DESIGN_PERMISSION_DENIED","FORM_DESIGN_LOCKED","FORM_DESIGN_CODE_CONFLICT","FORM_DESIGN_CMS_CONFLICT","FORM_DESIGN_CMS_SCHEMA_MISMATCH","FORM_DESIGN_CMS_NOT_FOUND","FORM_DESIGN_BINDING_MISSING","FORM_DESIGN_OPERATION_CONFLICT","FORM_DESIGN_CMS_UNAVAILABLE","FORM_DESIGN_PATCH_FAILED","FORM_DESIGN_COMPENSATION_FAILED","FORM_DESIGN_RECOVERY_REQUIRED"],So=d.enum(Rx),Al=d.enum(["wait","resume","retry_new_operation","manual_recovery","none"]),wl=d.enum(["not_started","pending","succeeded","failed"]),Pl=d.object({operation_id:lo,operation_fingerprint:ue,site_id:k,form_definition_id:pi,stage:ho,status:Tl,base_snapshot_id:I,candidate_snapshot_id:I.nullable(),before_form_code:d.string().regex(Sn).nullable(),materialized_form_code:d.string().regex(Sn).nullable(),expected_form_spec_hash:ue,draft_form_spec_hash:ue,materialized_form_spec_hash:ue.nullable(),expected_cms_schema_hash:ue.nullable(),desired_cms_schema_hash:ue,retry_count:d.number().int().nonnegative(),failure_stage:kl.nullable(),last_error_code:So.nullable(),retryable:d.boolean(),next_action:Al,preview_refresh_status:wl,created_at:d.string().datetime({offset:!0}),updated_at:d.string().datetime({offset:!0})}).strict().superRefine((e,n)=>{if(!(e.stage!=="committed"&&e.status!=="succeeded")){(e.stage!=="committed"||e.status!=="succeeded")&&n.addIssue({code:"custom",path:["status"],message:"committed stage and succeeded status must be reported together"});for(let s of["candidate_snapshot_id","materialized_form_code","materialized_form_spec_hash"])e[s]===null&&n.addIssue({code:"custom",path:[s],message:`${s} is required for a committed success`});(e.failure_stage!==null||e.last_error_code!==null||e.retryable||e.next_action!=="none")&&n.addIssue({code:"custom",path:["next_action"],message:"a committed success cannot retain an error or retry action"})}}),fo=d.object({operation:Pl}).strict(),LL=fo,ML=fo,UL=d.object({operation_fingerprint:ue}).strict(),FL=fo,Ix=d.preprocess(e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let n="form_metadata"in e?e:{...e,form_metadata:null};return"standardization"in e||"confirm_standardization"in e?n:{...n,standardization:{grade:"standard",required:!1,pending_confirmations:[]},confirm_standardization:!1}},bx),GL=d.object({operation:Pl,request:Ix,cms_replace_result:d.unknown().nullable()}).strict(),Tx=d.object({stage:ho.optional(),status:Tl.optional(),candidate_snapshot_id:I.nullable().optional(),before_form_code:d.string().regex(Sn).nullable().optional(),materialized_form_code:d.string().regex(Sn).nullable().optional(),materialized_form_spec_hash:ue.nullable().optional(),retry_count:d.number().int().nonnegative().optional(),failure_stage:kl.nullable().optional(),last_error_code:So.nullable().optional(),retryable:d.boolean().optional(),next_action:Al.optional(),preview_refresh_status:wl.optional()}).strict(),qL=d.object({expected_updated_at:d.string().datetime({offset:!0}),operation:Tx,cms_replace_result:d.unknown().nullable().optional()}).strict().refine(e=>Object.keys(e.operation).length>0||Object.hasOwn(e,"cms_replace_result"),{message:"transition must change operation state or CMS result"}),WL=d.object({code:So,message:d.string().trim().min(1).max(500),retryable:d.boolean(),operation_id:lo.optional(),stage:ho.optional()}).strict();function kx(e){return fx.parse({site_id:e.site_id,form_definition_id:e.form_definition_id,base_snapshot_id:e.base_snapshot_id,expected_form_spec_hash:e.expected_form_spec_hash,expected_cms_schema_hash:e.expected_cms_schema_hash,draft_form_spec_hash:e.draft_form_spec_hash,desired_cms_schema_hash:e.desired_cms_schema_hash,affected_files_hash:e.affected_files_hash,form_metadata:e.form_metadata,shared_reference_hash:e.shared_impact.reference_hash,shared_reference_count:e.shared_impact.block_count,confirm_shared_update:e.confirm_shared_update,recreate_missing_binding:e.recreate_missing_binding,standardization:e.standardization,confirm_standardization:e.confirm_standardization})}function fl(e){for(let n=0;n<e.length;n+=1){let s=e.charCodeAt(n);if(s>=55296&&s<=56319){let i=e.charCodeAt(n+1);if(n+1>=e.length||i<56320||i>57343)throw new TypeError("canonical JSON cannot contain a lone surrogate");n+=1}else if(s>=56320&&s<=57343)throw new TypeError("canonical JSON cannot contain a lone surrogate")}}function co(e,n){if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError("canonical JSON numbers must be finite");return JSON.stringify(e)}if(typeof e=="string")return fl(e),JSON.stringify(e);if(typeof e!="object")throw new TypeError("value is not valid JSON");if(n.has(e))throw new TypeError("canonical JSON cannot contain cycles");n.add(e);try{if(Array.isArray(e)){let o=[];for(let c=0;c<e.length;c+=1){if(!(c in e))throw new TypeError("canonical JSON cannot contain sparse arrays");o.push(co(e[c],n))}return`[${o.join(",")}]`}let s=Object.getPrototypeOf(e);if(s!==Object.prototype&&s!==null)throw new TypeError("canonical JSON objects must be plain records");let i=e;return`{${Object.keys(i).sort().map(o=>(fl(o),`${JSON.stringify(o)}:${co(i[o],n)}`)).join(",")}}`}finally{n.delete(e)}}function bo(e){return co(e,new Set)}async function di(e){let n=bo(e),s=new TextEncoder().encode(n),i=globalThis.crypto?.subtle?new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",s)):(await import("@noble/hashes/sha256")).sha256(s);return`sha256:${Array.from(i,o=>o.toString(16).padStart(2,"0")).join("")}`}async function BL(e){return di(_o.parse(e))}async function KL(e){return di(Rl.parse(e))}async function zL(e){let n=Sx.parse(e).map(s=>({...s})).sort((s,i)=>s.path<i.path?-1:s.path>i.path?1:0);return di({version:1,files:n})}async function HL(e){return di(kx(e))}import{z as D}from"zod";var YL=["page-seo","root-layout-metadata","nav-items"],XL=D.object({path:D.string(),title:D.string(),description:D.string().optional(),keywords:D.string().optional(),meta_tags_json:D.record(D.string(),D.record(D.string(),D.string())).nullish(),schema_json:D.union([D.record(D.string(),D.unknown()),D.array(D.record(D.string(),D.unknown())),D.string()]).nullish(),breadcrumbs_json:D.array(D.object({name:D.string().optional(),text:D.string().optional(),url:D.string().nullish()})).nullish()}),QL=D.object({metadataBase:D.string().optional(),title:D.union([D.string(),D.object({default:D.string().optional(),template:D.string().optional(),absolute:D.string().optional()})]).optional(),description:D.string().optional(),keywords:D.string().optional(),openGraph:D.object({title:D.string().optional(),description:D.string().optional(),type:D.string().optional(),siteName:D.string().optional(),url:D.string().optional(),locale:D.string().optional(),images:D.array(D.union([D.string(),D.object({url:D.string(),alt:D.string().optional()})])).optional()}).optional(),twitter:D.object({card:D.string().optional(),title:D.string().optional(),description:D.string().optional(),images:D.array(D.string()).optional()}).optional(),alternates:D.object({canonical:D.string().optional()}).optional(),robots:D.union([D.string(),D.record(D.string(),D.unknown())]).optional()}),Cl=()=>D.object({label:D.string(),href:D.string().optional(),targetType:D.enum(["page","anchor","external","email","phone","file","group"]).optional(),role:D.enum(["link","cta"]).optional(),openInNewTab:D.boolean().optional(),nofollow:D.boolean().optional(),description:D.string().optional(),badge:D.string().optional(),iconKey:D.string().optional()}),ZL=Cl().extend({children:D.array(Cl()).optional()}),Ax=["title","description","keywords","breadcrumbs_json.*.name","breadcrumbs_json.*.text"],wx=["path","meta_tags_json.**","schema_json.**","breadcrumbs_json.*.url"],Px=["title","title.default","title.template","title.absolute","description","keywords","openGraph.title","openGraph.description","openGraph.siteName","openGraph.images.*.alt","twitter.title","twitter.description"],Cx=["metadataBase","openGraph.type","openGraph.url","openGraph.locale","openGraph.images.*","openGraph.images.*.url","twitter.card","twitter.images.*","alternates.canonical","robots.**"],vx=["label","description","badge"],Dx=["href","targetType","role","iconKey"],vl={"page-seo":{localizable:Ax,machine:wx},"root-layout-metadata":{localizable:Px,machine:Cx},"nav-items":{localizable:vx,machine:Dx}},Dl="*",Ol="**",Ox="children";function Nx(e){return typeof e=="number"||/^\d+$/.test(e)?Dl:e}function Nl(e,n){let s=n.map(Nx);return e!=="nav-items"?s:s.filter(i=>i!==Dl&&i!==Ox)}function jl(e,n){let s=e.split(".");for(let i=0;i<s.length;i+=1){if(s[i]===Ol)return!0;if(i>=n.length||s[i]!==n[i])return!1}return s.length===n.length}function jx(e,n){let s=e.split(".");if(n.length>=s.length)return!1;for(let i=0;i<n.length;i+=1){if(s[i]===Ol)return!0;if(s[i]!==n[i])return!1}return!0}function JL(e,n){let s=Nl(e,n);return s.length===0?!1:vl[e].localizable.some(i=>jl(i,s))}function eM(e,n){let s=Nl(e,n);if(s.length===0)return!0;let{localizable:i,machine:a}=vl[e];return[...i,...a].some(o=>jl(o,s)||jx(o,s))}var sM=["product-search","migration-products","standard-form","form-submission-infrastructure"],Lx=[{path:"app/search/page.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/entry.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/results.tsx",materializer:"product-search"},{path:"app/api/product-search/facets/route.ts",materializer:"product-search"},{path:"lib/cms/product-search.ts",materializer:"product-search"},{path:"lib/generated/product-search-value-codec.ts",materializer:"product-search"},{path:"lib/generated/product-search-config.json",materializer:"product-search"},{path:`lib/cms/generated/${yt}.ts`,materializer:"migration-products"},{path:`components/site/generated/${yt}-list.tsx`,materializer:"migration-products"},{path:`app/${yt}/[slug]/page.tsx`,materializer:"migration-products"},{path:`components/site/generated/${yt}-breadcrumb.tsx`,materializer:"migration-products"},{path:"components/site/generated/forms/vcp-form-runtime.tsx",materializer:"standard-form"},{path:"app/api/forms/[code]/route.ts",materializer:"form-submission-infrastructure"},{path:"hooks/use-cms-form-submit.ts",materializer:"form-submission-infrastructure"},{path:"lib/cms/forms.ts",materializer:"form-submission-infrastructure"}],Mx=[{prefix:"components/site/generated/forms/form-",suffix:".tsx",materializer:"standard-form"}],iM=[{path:`components/site/generated/${yt}-list-view.tsx`,reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u4E13\u7528\u4EA7\u54C1 Worker \u6309\u7AD9\u70B9\u8BBE\u8BA1\u751F\u6210\u5217\u8868\u89C6\u56FE\uFF1B\u9996\u6B21 fallback \u4E0D\u6539\u53D8\u5F52\u5C5E\uFF0C\u9759\u6001\u6587\u6848\u987B\u968F\u5B50\u7AD9\u7FFB\u8BD1\u3002"},{path:`components/site/generated/${yt}-detail-view.tsx`,reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u4E13\u7528\u4EA7\u54C1 Worker \u6309\u7AD9\u70B9\u8BBE\u8BA1\u751F\u6210\u8BE6\u60C5\u89C6\u56FE\uFF1B\u9996\u6B21 fallback \u4E0D\u6539\u53D8\u5F52\u5C5E\uFF0C\u9759\u6001\u6587\u6848\u987B\u968F\u5B50\u7AD9\u7FFB\u8BD1\u3002"},{path:"lib/cms/client.ts",reason:"\u4E0D\u662F\u7269\u5316\u4EA7\u7269\uFF1A\u6A21\u677F\u81EA\u5E26\u7684 CMS \u4F20\u8F93\u5C42\uFF0C\u7269\u5316\u5668\u53EA\u5BF9\u5B83\u505A\u5B9A\u70B9\u5B57\u7B26\u4E32\u5347\u7EA7\uFF08\u591A\u90E8\u5206\u8868\u5355\u63D0\u4EA4\u3001no-store \u8BFB\uFF09\uFF0C\u6574\u4EFD\u8986\u5199\u53CD\u800C\u4F1A\u62B9\u6389\u7AD9\u70B9\u4FA7\u7684\u5176\u4ED6\u5347\u7EA7\u3002"},{path:"components/site/generated/forms/form-<id>.spec.ts",reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u8868\u5355\u8BBE\u8BA1\u5668\u5199\u7684\u5B57\u6BB5\u6587\u6848\uFF0C\u5F52 FORM_SPEC_LOCALIZABLE_FIELD_PATHS \u7684\u5B57\u6BB5\u7EA7\u6E05\u5355\u7BA1\u8F96\u3002"},{path:"components/system/not-found-content.tsx",reason:"\u4E00\u6B21\u6027\u5199\u5165\u3001\u4E4B\u540E\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u5EFA\u7AD9\u65F6\u4EC5\u5728\u6A21\u677F\u539F\u7248\u4E0A\u6309\u7AD9\u70B9\u8BED\u79CD\u5199\u4E00\u6B21 404 \u6587\u6848\uFF0C\u4E4B\u540E\u7531\u7528\u6237\u3001\u8BBE\u8BA1\u5668\u6216 Agent \u7EF4\u62A4\uFF0C\u91CD\u8DD1\u4E5F\u4E0D\u4F1A\u8986\u5199\u6539\u8FC7\u7684\u5185\u5BB9\uFF1B\u5B50\u7AD9\u987B\u968F\u6574\u7AD9\u7FFB\u8BD1\u5B83\u3002"}];function Ux(e){return e.length>0&&!e.includes("/")&&!e.includes(".")}function aM(e){return Lx.some(n=>n.path===e)?!0:Mx.some(n=>!e.startsWith(n.prefix)||!e.endsWith(n.suffix)?!1:Ux(e.slice(n.prefix.length,e.length-n.suffix.length)))}import{z as Et}from"zod";var Fx=["provisioning","cms_app_created","seeded","ready","failed"],mM=Et.object({tenant_id:Et.string().min(1),site_id:k,collection_slug:Et.string().min(1),cms_collection_id:Et.string().min(1).nullable(),status:Et.enum(Fx),owned_by_vcp:Et.boolean(),run_id:V.nullable(),last_error:Et.string().nullable(),created_at:Et.string().datetime(),updated_at:Et.string().datetime()});var Ll="/vibe/v1";function Gx(e){let n=e?.trim().replace(/\/+$/,"");if(!n)return null;try{let s=new URL(n),i=s.pathname.replace(/\/+$/,"");return s.search="",s.hash="",s.pathname=i.endsWith(Ll)?i:Ll,s.href.replace(/\/+$/,"")}catch{return n}}function pM(e){let n=Gx(e.publicProxyUrl),s=e.cmsSiteId?.trim(),i=e.tenantId?.trim();return n&&s&&i?{cmsProxyUrl:n,cmsProjectId:s,cmsTenantId:i}:null}function uM(e){let n=e.tenant_id?.trim(),s=e.cms_site_id?.trim();if(!n||!s)throw new Error("CMS_REQUEST_CONTEXT_MISSING");return{Accept:"application/json","X-Tenant-Id":n,"X-Site-Id":s}}import{z as g}from"zod";var ui=g.string().url().refine(oE,{message:"URL must use http or https"}),Ml=g.string().trim().pipe(ui),qx=g.object({task_type:g.literal("home_url"),task_url:Ml,planned_num:g.number().int().min(1).max(20).optional()}).strict(),Wx=g.object({task_type:g.literal("url_list"),urls:g.array(ui).min(1).max(1e4)}).strict(),SM=g.discriminatedUnion("task_type",[qx,Wx]),fM=g.object({page:g.coerce.number().int().positive().default(1),page_size:g.coerce.number().int().min(1).max(20).default(20)}).strict(),bM=g.object({home_url:Ml}).strict(),Yt=g.string().uuid(),fn=g.string().uuid(),yM=g.object({task_uuid:Yt}).strict(),Ul=g.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]),Bx=g.object({task_uuid:Yt,status:g.literal("NOT_STARTED"),total:g.literal(0)}).strict(),Kx=g.object({task_uuid:Yt,status:g.literal("PROCESSING"),total:g.literal(0)}).strict(),xM=g.enum(["no_suitable_page_candidate","page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"]),zx=g.discriminatedUnion("status",[g.object({role:wt,status:g.literal("selected"),reason_code:g.null()}).strict(),g.object({role:wt,status:g.literal("not_found"),reason_code:g.literal("no_suitable_page_candidate")}).strict(),g.object({role:wt,status:g.literal("unknown"),reason_code:g.enum(["page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"])}).strict()]),Fl=g.array(zx).length(7).superRefine((e,n)=>{let s=new Set(e.map(i=>i.role));s.size!==e.length&&n.addIssue({code:"custom",message:"discovery coverage roles must be unique"});for(let i of wt.options)s.has(i)||n.addIssue({code:"custom",message:`discovery coverage is missing role ${i}`})}),Hx=g.object({task_uuid:Yt,status:g.literal("SUCCEEDED"),total:g.number().int().positive(),discovery_coverage:Fl.optional()}).strict(),$x=g.enum(["TASK_FAILED","PROVIDER_CAPABILITY_LIMIT","WEBSITE_UNREACHABLE"]),Vx=g.object({task_uuid:Yt,status:g.literal("FAILED"),total:g.literal(0),error_code:$x,error_message:g.string().min(1),failure_stage:Ul}).strict(),EM=g.discriminatedUnion("status",[Bx,Kx,Hx,Vx]),Yx=g.object({url:ui,raw_html:g.string().min(1)}).strict(),RM=g.object({task_uuid:Yt,status:g.literal("SUCCEEDED"),page:g.number().int().positive(),page_size:g.number().int().min(1).max(20),total:g.number().int().positive(),total_pages:g.number().int().positive(),pages:g.array(Yx).max(20),discovery_coverage:Fl.optional()}).strict().superRefine((e,n)=>{e.total_pages!==Math.ceil(e.total/e.page_size)&&n.addIssue({code:"custom",path:["total_pages"],message:"total_pages must equal ceil(total / page_size)"}),e.pages.length>e.page_size&&n.addIssue({code:"custom",path:["pages"],message:"pages must not exceed page_size"})}),IM=g.object({task_code:fn}).strict(),Xx=g.object({task_code:fn,status:g.literal("NOT_STARTED")}).strict(),Qx=g.object({task_code:fn,status:g.literal("PROCESSING")}).strict(),Zx=g.object({task_code:fn,status:g.literal("SUCCEEDED"),urls:g.array(ui)}).strict(),Jx=g.literal("SITEMAP_DISCOVERY_FAILED"),eE=g.object({task_code:fn,status:g.literal("FAILED"),error_code:Jx,error_message:g.string().min(1)}).strict(),TM=g.discriminatedUnion("status",[Xx,Qx,Zx,eE]),kM=g.object({company_name:g.string().regex(/\S/u)}).strict(),tE=g.object({company_name:g.string(),brand_name:g.string(),main_products:g.array(g.string()),industry:g.array(g.string()),subfields:g.array(g.string()),business_intro:g.string(),registered_capital:g.string(),legal_representative:g.string(),target_markets:g.array(g.string()),target_customer_industries:g.array(g.string()),target_customer_roles:g.array(g.string()),purchase_scenarios:g.string(),differentiators:g.array(g.string()),competitors:g.array(g.object({name:g.string(),official_url:g.string()}).strict()).max(3),qualifications:g.array(g.string()),representative_cases:g.array(g.string()),acquisition_channels:g.array(g.string()),desired_domain:g.string(),brand_tone:g.string(),timezone:g.string()}).strict(),_i=g.object({company_uuid:g.string().uuid(),company_info:tE,created_at:g.string().datetime(),updated_at:g.string().datetime()}),nE=_i.extend({status:g.literal("NOT_STARTED"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.null(),completed_at:g.null()}).strict(),sE=_i.extend({status:g.literal("PROCESSING"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.string().datetime(),completed_at:g.null()}).strict(),Gl=_i.extend({status:g.literal("SUCCEEDED"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.string().datetime(),completed_at:g.string().datetime()}).strict(),ql=_i.extend({status:g.literal("FAILED"),last_error_code:g.string().min(1),last_error_message:g.string().min(1),started_at:g.string().datetime(),completed_at:g.string().datetime()}).strict(),AM=g.discriminatedUnion("status",[Gl,ql]),wM=g.discriminatedUnion("status",[nE,sE,Gl,ql]),iE=["BAD_REQUEST","NOT_FOUND","PAYLOAD_TOO_LARGE","INTERNAL_SERVER_ERROR","UNAUTHORIZED","FORBIDDEN","INVALID_TASK_TYPE","TASK_URL_REQUIRED","INVALID_PLANNED_NUM","URL_LIST_REQUIRED","URL_LIST_LIMIT_EXCEEDED","INVALID_URL_LIST","INVALID_PAGINATION","INVALID_TASK_CODE","INVALID_HOME_URL","TASK_CODE_HOME_URL_CONFLICT","SITEMAP_TASK_NOT_FOUND","SITEMAP_DISCOVERY_FAILED","TASK_NOT_FOUND","PROVIDER_CAPABILITY_LIMIT","TASK_FAILED","WEBSITE_UNREACHABLE"],aE=g.enum(iE),PM=g.object({error_code:aE,error_message:g.string().min(1),failure_stage:Ul.optional(),task_uuid:Yt.optional(),task_code:fn.optional()}).strict();function oE(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}import{z as B}from"zod";var Qe=B.string().url().refine(mE,{message:"URL must use http or https"}),Wl=B.string().min(1).max(512),gi=B.string().datetime({offset:!0}),Bl=B.enum(["scraping","completed","failed","expired"]),DM=B.object({url:Qe,ignore_cache:B.boolean(),sitemap:B.enum(["include","skip"]),include_subdomains:B.boolean(),ignore_query_parameters:B.boolean(),limit:B.number().int().min(1).max(1e5)}).strict(),OM=B.object({links:B.array(Qe).max(1e5)}).strict(),NM=B.object({url:Qe,limit:B.number().int().min(1).max(1e5),max_discovery_depth:B.literal(1),crawl_entire_domain:B.literal(!1),allow_subdomains:B.literal(!0),sitemap:B.literal("skip")}).strict(),jM=B.object({crawl_id:Wl,expires_at:gi.optional()}).strict(),LM=B.object({status:Bl,urls:B.array(Qe).max(1e5),next:Qe.optional(),expires_at:gi}).strict(),MM=B.object({url:Qe,formats:B.tuple([B.literal("rawHtml")]),only_main_content:B.literal(!1),max_age:B.number().int().nonnegative()}).strict(),UM=B.object({url:Qe,raw_html:B.string().min(1),status_code:B.number().int().min(100).max(599).nullable()}).strict(),FM=B.object({urls:B.array(Qe).min(1).max(1e4),formats:B.tuple([B.literal("rawHtml")]),ignore_invalid_urls:B.literal(!1),max_age:B.number().int().nonnegative(),max_concurrency:B.number().int().positive().optional()}).strict(),GM=B.object({batch_id:Wl,expires_at:gi.optional()}).strict(),rE=B.object({url:Qe,raw_html:B.string().min(1)}).strict(),qM=B.object({status:Bl,total:B.number().int().nonnegative(),completed:B.number().int().nonnegative(),pages:B.array(rE).max(1e4),next:Qe.optional(),expires_at:gi}).strict().superRefine((e,n)=>{e.completed>e.total&&n.addIssue({code:"custom",path:["completed"],message:"completed must not exceed total"})}),cE=B.object({url:Qe,error_message:B.string().min(1)}).strict(),WM=B.object({errors:B.array(cE).max(1e4),robots_blocked:B.array(Qe).max(1e4)}).strict(),BM=B.object({active:B.number().int().nonnegative(),waiting:B.number().int().nonnegative(),max_concurrency:B.number().int().positive()}).strict();function mE(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}var Kl=["write_file","edit_file","delete_file"],zl="apply_patch_batch",lE=["set_breadcrumb_placement"],pE=[...Kl,zl,...lE];function dE(e){return Kl.includes(e)}function zM(e){return pE.includes(e)}function HM(e){return dE(e)||e===zl}import{z as y}from"zod";var Hl=y.lazy(()=>bn),uE=y.enum(["page","block"]),Si=y.enum(["component","page","pages"]),_E=y.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),Xt=_E,$l=y.object({requested_locale:Xt,resolved_locale:Xt,fallback_used:y.boolean()}).strict(),ms=y.object({id:y.string().uuid(),key:y.string().min(1),name:y.string().min(1)}).strict(),hi=ms.extend({color:y.string().nullable()}).strict(),QM=y.object({kind:uE,category_id:y.string().uuid().optional(),tag_id:y.string().uuid().optional(),search:y.string().trim().min(1).max(200).optional(),limit:y.coerce.number().int().min(1).max(50).default(20),cursor:y.string().min(1).optional()}).strict(),gE=y.object({stable_key:y.string().min(1),type:Si,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnail_url:y.string().url().nullable(),resolved_version:y.number().int().positive(),content_schema_version:y.literal(3),category:ms.nullable(),tags:y.array(hi),page_count:y.number().int().nonnegative(),component_count:y.number().int().nonnegative(),locale:$l}).strict(),ZM=y.object({items:y.array(gE),facets:y.object({categories:y.array(ms),tags:y.array(hi)}).strict(),next_cursor:y.string().nullable()}).strict(),JM=y.object({operation_id:y.string().uuidv7(),resolved_version:y.number().int().positive(),base_sitemap_id:y.string().uuid(),base_sitemap_version:y.number().int().positive(),sitemap:Hl,target_page_id:y.string().min(1).optional()}).strict(),eU=y.object({next_sitemap:Hl,applied:y.object({stable_key:y.string().min(1),resolved_version:y.number().int().positive(),template_type:Si,page_ids:y.array(y.string().min(1)),block_ids:y.array(y.string().min(1))}).strict(),locale:$l,warnings:y.array(y.string())}).strict(),Vl=y.object({nodeId:y.string().uuid(),type:y.string().trim().min(1).max(100),label:y.string().trim().min(1).max(200),variant:y.string().trim().min(1).max(100).optional(),order:y.number().int().nonnegative(),props:y.record(y.string(),y.unknown()),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),Yl=y.object({nodeId:y.string().uuid().optional(),slug:y.string().regex(/^\/$|^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u),navigation:y.object({showInHeader:y.boolean(),showInFooter:y.boolean(),order:y.number().int().nonnegative()}).strict(),components:y.array(Vl).min(1).max(100),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),hE=Yl.extend({nodeId:y.uuidv7(),parentNodeId:y.uuidv7().optional()}).strict(),SE=y.object({pages:y.array(hE).min(1).max(50),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict().superRefine(({pages:e},n)=>{let s=new Map(e.map(a=>[a.nodeId,a])),i=e.flatMap(a=>[a.nodeId,...a.components.map(o=>o.nodeId)]);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["pages"],message:"Node ids must be unique within the shared structure."}),new Set(e.map(a=>a.slug)).size!==e.length&&n.addIssue({code:"custom",path:["pages"],message:"Page slugs must be unique."});for(let[a,o]of e.entries()){if(o.parentNodeId===void 0)continue;let c=_=>n.addIssue({code:"custom",path:["pages",a,"parentNodeId"],message:_}),r=s.get(o.parentNodeId);r||c("Parent must reference a page in this template."),o.parentNodeId===o.nodeId&&c("A page cannot be its own parent."),(o.slug==="/"||r?.slug==="/")&&c("The home page cannot be a parent or child."),r?.parentNodeId!==void 0&&c("Pages allow at most two levels; the parent must be a root page.");let m=new Set([o.nodeId]),x=o.parentNodeId;for(;x!==void 0;){if(m.has(x)){c("Page parent references must not contain a cycle.");break}m.add(x),x=s.get(x)?.parentNodeId}}}),fE=y.union([Vl,Yl,SE]),bE=y.object({title:y.string().min(1).max(200),description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192)}).strict(),yE=y.object({locale:Xt,title:y.string().min(1).max(200),content:y.object({description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192),nodes:y.record(y.string().uuid(),bE)}).strict()}).strict(),tU=y.object({templateId:y.string().uuid(),stableKey:y.string().min(1),type:Si,resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),structure:fE,requestedLocale:Xt,resolvedLocale:Xt,fallbackUsed:y.boolean(),contents:y.array(yE).length(1)}).strict().superRefine((e,n)=>{(e.type==="component"&&!("type"in e.structure)||e.type==="page"&&!("components"in e.structure)||e.type==="pages"&&!("pages"in e.structure))&&n.addIssue({code:"custom",path:["structure"],message:"Template type and structure must match."});let s=xE(e.structure),i=new Set(Object.keys(e.contents[0]?.content.nodes??{}));(s.size!==i.size||[...s].some(a=>!i.has(a)))&&n.addIssue({code:"custom",path:["contents",0,"content","nodes"],message:"Localized nodes must exactly match the structure nodes."}),e.contents[0]?.locale!==e.resolvedLocale&&n.addIssue({code:"custom",path:["contents"],message:"Resolved locale must match returned content."}),e.fallbackUsed!==(e.requestedLocale!==e.resolvedLocale)&&n.addIssue({code:"custom",path:["fallbackUsed"],message:"fallbackUsed must match locale resolution."})}),nU=y.object({items:y.array(y.object({stableKey:y.string().min(1),type:Si,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnailUrl:y.string().url().nullable(),resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),category:ms.nullable(),tags:y.array(hi),pageCount:y.number().int().nonnegative(),componentCount:y.number().int().nonnegative(),requestedLocale:Xt,resolvedLocale:Xt,fallbackUsed:y.boolean()}).strict()),facets:y.object({categories:y.array(ms),tags:y.array(hi)}).strict(),nextCursor:y.string().nullable()}).strict().superRefine((e,n)=>{e.items.forEach((s,i)=>{s.fallbackUsed!==(s.requestedLocale!==s.resolvedLocale)&&n.addIssue({code:"custom",path:["items",i,"fallbackUsed"],message:"fallbackUsed must match locale resolution."})})});function xE(e){if("type"in e)return new Set([e.nodeId]);let n="pages"in e?e.pages:[e];return new Set(n.flatMap(s=>[...s.nodeId?[s.nodeId]:[],...s.components.map(i=>i.nodeId)]))}function sU(e){return bo({tenant_id:e.tenant_id,site_id:e.site_id,stable_key:e.stable_key,resolved_version:e.request.resolved_version,base_sitemap_id:e.request.base_sitemap_id,base_sitemap_version:e.request.base_sitemap_version,sitemap:e.request.sitemap,target_page_id:e.request.target_page_id??null})}import{z as $}from"zod";var EE=["pending_dns","active","failed","removing"],RE=$.enum(EE),IE=["serve_site","redirect_301"],TE=$.enum(IE),kE=["traffic","ownership","certificate_delegation"],yo=$.enum(kE),AE=["pending","verified"],wE=$.enum(AE),PE=["not_applicable","unavailable","not_needed","auto_applied","confirmation_required","blocked"],CE=$.enum(PE),xo=$.enum(["prepare_configuration","apply_configuration","verify_dns","remediate_dns","confirm_dns_remediation"]),vE=$.enum(["accepted","running","succeeded","failed"]),DE=$.object({code:$.string().min(1),message:$.string().min(1)}).strict(),OE=$.object({purpose:yo,verified:$.boolean(),observedValues:$.array($.string())}).strict(),Xl=$.object({ready:$.boolean(),providerReady:$.boolean(),dnsVerified:$.boolean(),records:$.array(OE)}).strict(),Ql=$.object({type:$.string().min(1),name:$.string().min(1),value:$.string().min(1),ttl:$.number().nullable()}).strict(),NE=$.object({purpose:yo,action:$.enum(["none","create","update","blocked"]),before:Ql.nullable(),after:Ql.nullable()}).strict(),Zl=$.object({domainId:$.string().min(1),status:CE,changes:$.array(NE)}).strict(),jE=$.object({purpose:yo,type:$.string().min(1),name:$.string().min(1),value:$.string().min(1),verificationStatus:wE}).strict(),Jl=$.object({id:$.string().min(1),hostname:$.string().min(1),isPrimary:$.boolean(),routingMode:TE,observedStatus:RE,lastVerifiedAt:$.string().datetime().nullable(),dnsRecords:$.array(jE)}).strict().superRefine((e,n)=>{LE(e.hostname)||n.addIssue({code:"custom",path:["hostname"],message:"hostname must be a canonical ASCII hostname"}),e.isPrimary&&e.routingMode!=="serve_site"&&n.addIssue({code:"custom",path:["routingMode"],message:"a primary domain must serve the site"}),!e.isPrimary&&e.routingMode!=="redirect_301"&&n.addIssue({code:"custom",path:["routingMode"],message:"a non-primary domain must redirect with 301"})}),ep=$.object({primaryDomain:Jl.nullable(),redirectDomains:$.array(Jl)}).strict().superRefine((e,n)=>{e.primaryDomain!==null&&(!e.primaryDomain.isPrimary||e.primaryDomain.routingMode!=="serve_site")&&n.addIssue({code:"custom",path:["primaryDomain"],message:"primaryDomain must be primary and serve the site"});for(let[i,a]of e.redirectDomains.entries())(a.isPrimary||a.routingMode!=="redirect_301")&&n.addIssue({code:"custom",path:["redirectDomains",i],message:"redirectDomains must be non-primary 301 redirects"});e.primaryDomain!==null&&e.redirectDomains.some(a=>a.hostname===e.primaryDomain?.hostname)&&n.addIssue({code:"custom",path:["redirectDomains"],message:"primaryDomain must not also be a redirect"});let s=[...e.primaryDomain===null?[]:[e.primaryDomain.hostname],...e.redirectDomains.map(i=>i.hostname)];new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["redirectDomains"],message:"domain hostnames must be unique"})}),fi=$.object({id:$.string().min(1),type:xo,status:vE,error:DE.nullable(),result:$.union([Xl,Zl]).nullable().optional()}).strict().superRefine((e,n)=>{if(e.status==="failed"&&e.error===null&&n.addIssue({code:"custom",path:["error"],message:"failed operations must include a stable error"}),e.status!=="failed"&&e.error!==null&&n.addIssue({code:"custom",path:["error"],message:"non-failed operations must not include an error"}),!(e.result===void 0||e.result===null)){if(e.status!=="succeeded"){n.addIssue({code:"custom",path:["result"],message:"operation results only belong to succeeded operations"});return}if(e.type==="verify_dns"){Xl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"verify_dns operations require a DNS verification result"});return}if(e.type==="remediate_dns"){Zl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"remediate_dns operations require a DNS remediation result"});return}n.addIssue({code:"custom",path:["result"],message:"only verify_dns and remediate_dns operations may carry a result"})}});function LE(e){if(e!==e.trim()||e!==e.toLowerCase()||e.length>253||e.endsWith("."))return!1;let n=e.split(".");return n.length>=2&&n[n.length-1].length>=2&&n.every(s=>s.length>=1&&s.length<=63&&/^[a-z0-9-]+$/.test(s)&&!s.startsWith("-")&&!s.endsWith("-"))}import{z as Fe}from"zod";import{z as b}from"zod";var ME=b.enum(["active","completed","canceled"]),UE=b.enum(["quality","domain","gsc","publish"]),yi=b.enum(["pending","running","succeeded","failed"]),np=yi,sp=b.enum(["pending","running","completed"]),FE=b.object({group_code:b.string().min(1),name:b.string().min(1),score:b.number().nonnegative(),total_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),running_status:sp,result_text:b.string()}).strict(),GE=b.object({id:b.number().int().positive().optional(),quality_task_id:b.number().int().positive(),item_code:b.string().min(1),status:yi,is_repaired:b.boolean(),total_score:b.number().nonnegative(),score:b.number().nonnegative(),check_result:b.unknown().nullable(),remediation_items:b.unknown().nullable(),result_text:b.string(),created_at:b.string().min(1),updated_at:b.string().min(1),item_name:b.string().min(1),dimension_code:b.enum(["reach","trust","convert","safe"]),group_code:b.string().min(1),auto_fix:b.boolean()}).strict(),qE=b.object({dimension_code:b.enum(["reach","trust","convert","safe"]),name:b.string().min(1),alias_en:b.string().min(1),description:b.string(),tips:b.string(),score:b.number().nonnegative(),repaired_score:b.number().nonnegative(),total_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),running_status:sp,problem_group_count:b.number().int().nonnegative(),remediation_items:b.array(GE),groups:b.array(FE)}).strict(),WE=b.object({id:b.number().int().positive(),task_code:b.string().uuid(),scene_code:b.enum(["site_publish","vcp_published_pages","content_publish"]),tenant_id:b.string().min(1),vcp_site_id:k,cms_site_id:b.string().min(1),checked_url:b.string().url(),quality_params:b.record(b.string(),b.unknown()).nullable(),status:yi,error_info:b.record(b.string(),b.unknown()).nullable(),created_at:b.string().min(1),updated_at:b.string().min(1)}).strict(),BE=b.union([b.object({}).strict(),b.object({summary:b.object({final_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),group_count:b.number().int().nonnegative(),problem_group_count:b.number().int().nonnegative()}).strict(),dimensions:b.array(qE)}).strict()]),tp=b.object({quality_info:WE,quality_detail:BE}).strict().superRefine((e,n)=>{let s="summary"in e.quality_detail;e.quality_info.status!=="failed"&&!s&&n.addIssue({code:"custom",message:"nonfailed quality tasks require complete detail",path:["quality_detail"]}),e.quality_info.status==="failed"&&s&&n.addIssue({code:"custom",message:"failed quality tasks require empty detail",path:["quality_detail"]})}),dU=b.object({item_code:b.string().min(1),remediation_items:b.unknown().nullable()}).strict(),KE=b.object({item_code:b.string().min(1),repair_status:b.enum(["succeeded","failed"]),message:b.string().min(1).optional(),error_code:b.string().min(1).optional(),metadata:b.record(b.string(),b.unknown()).optional()}).strict(),ip=b.object({items:b.array(KE)}).strict(),uU=b.object({task_code:b.string().min(1),status:np,result:ip.optional()}).strict().superRefine((e,n)=>{e.status==="succeeded"&&e.result===void 0&&n.addIssue({code:"custom",path:["result"],message:"succeeded repair tasks require a complete result"}),(e.status==="pending"||e.status==="running")&&e.result!==void 0&&n.addIssue({code:"custom",path:["result"],message:"nonterminal repair tasks cannot expose a result"})}),jt=b.object({id:_s,tenant_id:b.string().min(1),site_id:k,status:ME,current_step:UE,quality_task_code:b.string().uuid().nullable(),quality_task_status:yi,repair_task_code:b.string().min(1).nullable(),repair_task_status:np,publish_deployment_id:dt.nullable(),domain_hostname:b.string().min(1).nullable(),domain_operation_type:xo.nullable(),domain_operation_payload:b.record(b.string(),b.unknown()).nullable(),domain_preparation_operation_id:b.string().min(1).nullable(),domain_operation_id:b.string().min(1).nullable(),revision:b.number().int().positive(),created_at:b.string().min(1),updated_at:b.string().min(1),completed_at:b.string().min(1).nullable(),canceled_at:b.string().min(1).nullable()}).strict().superRefine((e,n)=>{if(e.domain_operation_type===null){e.domain_operation_payload!==null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"domain_operation_payload must be null without an active domain operation"}),e.domain_operation_id!==null&&n.addIssue({code:"custom",path:["domain_operation_id"],message:"domain_operation_id must be null without an active domain operation"});return}e.domain_hostname===null&&n.addIssue({code:"custom",path:["domain_hostname"],message:"an active domain operation requires a hostname"}),e.domain_operation_payload===null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"an active domain operation requires a payload"})}),_U=b.object({}).strict(),gU=b.object({expected_revision:b.number().int().nonnegative(),current_step:b.enum(["domain","gsc","publish"]),skip_domain_binding:b.boolean().optional()}).strict(),hU=b.object({expected_revision:b.number().int().nonnegative()}).strict(),zE=b.object({workflow:jt.nullable(),can_cancel:b.boolean()}).strict(),SU=U(zE).strict(),HE=b.object({workflow:jt,can_cancel:b.boolean()}).strict(),fU=U(HE).strict(),$E=b.object({workflow:jt,deployment:b.lazy(()=>Lt)}).strict(),bU=U($E).strict(),VE=b.object({workflow:jt,can_cancel:b.boolean(),quality_result:tp.optional(),safety_gate_enabled:b.boolean().optional(),repair_result:ip.optional(),final_quality_result:tp.optional(),message:b.string().min(1).optional()}).strict(),yU=U(VE).strict();function xU(e){if(e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail))return[];let n=new Set(["heading_structure","click_obstruction","page_runtime_error"]);return e.quality_detail.dimensions.flatMap(s=>s.remediation_items.filter(i=>i.status==="succeeded"&&bi(i)==="not_passed"&&i.auto_fix&&n.has(i.item_code)).map(i=>({item_code:i.item_code,remediation_items:i.remediation_items})))}function EU(e,n){let s=e.map(o=>o.item_code),i=n.items.map(o=>o.item_code);if(new Set(s).size!==s.length||new Set(i).size!==i.length||s.length!==i.length)return!1;let a=new Set(s);return n.items.every(o=>a.has(o.item_code)&&o.repair_status==="succeeded")}function RU(e,n){return e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail)||YE(e)?null:e}function YE(e){let n=e.quality_info.error_info;return e.quality_info.scene_code!=="site_publish"||n?.stage!=="html_sampling"||n.code!=="PAGE_SAMPLING_ISSUES"&&n.code!=="PAGE_RUNTIME_ERRORS"?!1:[n.failed_urls,n.sampling_issues].flatMap(i=>Array.isArray(i)?i:[]).some(i=>{if(!i||typeof i!="object")return!1;let a=i;if(a.page_type!=="general_page"||a.http_status!==404||typeof a.url!="string")return!1;try{let o=new URL(e.quality_info.checked_url),c=new URL(a.url,o);return c.origin===o.origin&&!c.username&&!c.password}catch{return!1}})}var IU=b.enum(["checking","passed","not_passed","failed","not_checked"]);function bi(e){if(e.status==="pending"||e.status==="running")return"checking";if(e.status!=="succeeded")return"failed";let n=e.result_text?.trim();if(n==="\u8D28\u68C0\u9879\u5173\u95ED\uFF0C\u6682\u672A\u68C0\u6D4B")return"not_checked";if(n==="\u8D28\u91CF\u68C0\u6D4B\u9879\u6267\u884C\u5931\u8D25")return"failed";let s=typeof e.check_result=="boolean"?[e.check_result]:e.check_result&&typeof e.check_result=="object"?Object.values(e.check_result):[];return e.score<e.total_score||s.includes(!1)?"not_passed":"passed"}function XE(e){let n=bi(e);return n==="failed"||n==="not_passed"}function TU(e){let n={status:"unavailable",issueCount:0};if(!e||e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail))return n;let s=e.quality_detail.dimensions.filter(o=>o.dimension_code==="safe");if(s.length!==1)return n;let i=s[0];if(i.running_status!=="completed"||!i.remediation_items.length||i.remediation_items.some(o=>o.dimension_code!=="safe"||bi(o)==="checking"||bi(o)==="not_checked"))return n;let a=i.remediation_items.filter(XE).length;return a>0?{status:"blocked",issueCount:a}:i.score<i.pass_score?n:{status:"passed",issueCount:0}}var QE=Fe.object({hostname:Fe.string().min(1),expected_revision:Fe.number().int().nonnegative()}).strict(),ap=Fe.object({workflow:jt,operation:fi}).strict(),ZE=U(ap).strict(),JE=Fe.object({expected_revision:Fe.number().int().nonnegative()}).strict(),eR=Fe.object({workflow:jt,operation:fi}).strict(),tR=U(eR).strict(),Eo=Fe.object({workflow:jt,operation:fi.nullable()}).strict(),nR=U(Eo).strict(),sR=Eo,iR=U(sR).strict(),vU=U(ep).strict(),aR=Fe.object({published:Fe.boolean(),hostname:Fe.string(),url:Fe.string(),sandbox_url:Fe.union([Fe.string().url(),Fe.literal("")])}).strict().superRefine((e,n)=>{e.published||(e.hostname!==""&&n.addIssue({code:"custom",path:["hostname"],message:"unpublished sites must not include a hostname"}),e.url!==""&&n.addIssue({code:"custom",path:["url"],message:"unpublished sites must not include a URL"}))}),DU=U(aR).strict(),OU=QE,NU=ap,jU=ZE,LU=Eo,MU=nR,UU=iR,FU=JE,GU=tR;import{z as ze}from"zod";var oR=["started","success","failed","canceled"],Ro=ze.enum(oR),rR=["inactive","pending_binding","active"],Io=ze.enum(rR),cR=["domain","url_prefix"],To=ze.enum(cR),mR=["not_connected","authorizing","matching_property","ready","failed","canceled","domain_mismatch"],ko=ze.enum(mR),pt=ze.string().nullable(),op=ze.object({}).strict(),Ao=ze.object({authorize_url:ze.string().url(),custom_domain:pt}).strict(),rp=U(Ao),lR=ze.object({auth_status:Ro,binding_status:Io,credential_connected:ze.boolean(),custom_domain:pt,gsc_site_url:pt,property_type:To.nullable(),auth_error_code:pt,auth_error_message:pt}).strict(),cp=ze.object({auth_status:Ro,binding_status:Io,credential_connected:ze.boolean(),custom_domain:pt,gsc_site_url:pt,property_type:To.nullable(),auth_error_code:pt,auth_error_message:pt,current_domain:pt,state:ko,ready:ze.boolean()}).strict().superRefine((e,n)=>{let s=dR(e,e.current_domain),i=s==="ready";e.state!==s&&n.addIssue({code:"custom",path:["state"],message:`state must equal ${s} for the supplied GSC facts`}),e.ready!==i&&n.addIssue({code:"custom",path:["ready"],message:`ready must equal ${String(i)} for the supplied GSC facts`})}),pR=U(cp);function ls(e){let n=e?.trim()??"";if(!n)return"";let s=/^[a-z][a-z0-9+.-]*:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).hostname.replace(/\.+$/,"").toLowerCase()}catch{return n.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0].replace(/\.+$/,"").toLowerCase()}}function dR(e,n){let s=e.gsc_site_url?.trim()??"",i=ls(e.custom_domain),a=ls(n??("current_domain"in e?e.current_domain:void 0)),o=i.length>0&&a.length>0&&i===a,c=uR(s,e.property_type,a);return e.auth_status==="canceled"?"canceled":e.auth_status==="failed"?"failed":e.auth_status==="started"?"authorizing":!e.credential_connected||e.binding_status==="inactive"?"not_connected":s.length===0||e.property_type===null?"matching_property":!o||!c?"domain_mismatch":e.binding_status==="pending_binding"?"matching_property":e.auth_status==="success"&&e.binding_status==="active"&&e.credential_connected&&s.length>0&&o&&c?"ready":"failed"}function uR(e,n,s){let i=e?.trim()??"",a=ls(s);if(!i||!a||!n)return!1;if(n==="domain"){let o=/^sc-domain:(.+)$/i.exec(i);if(!o)return!1;let c=o[1].trim();if(!c||/[/:?#]/.test(c))return!1;let r=ls(c);return r?a===r||a.endsWith(`.${r}`):!1}try{let o=new URL(i);return o.protocol!=="https:"||o.username||o.password||o.port||o.pathname!=="/"||o.search||o.hash?!1:ls(o.hostname)===a}catch{return!1}}var KU=op,zU=Ao,HU=rp,$U=ko,VU=Ro,YU=Io,XU=To,QU=ko,ZU=op,JU=Ao,eF=rp,tF=lR,nF=cp,sF=pR;import{z as N}from"zod";var He=N.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),st=N.string().min(1).max(4096),yn=N.string().regex(/^[A-Za-z0-9_-]{43}$/),xn=N.string().max(300),wo=N.string().datetime({offset:!0}).nullable(),mp=N.string().regex(/^[A-Z][A-Z0-9_]*$/).max(100).nullable(),_R=["authorized","pending","failed","revoked","expired","not_authorized"],gR=N.enum(_R),hR=["pending","succeeded","failed","canceled","expired","superseded"],SR=N.enum(hR),fR=["unconfigured","configured","needs_reconfiguration","unverified"],bR=N.enum(fR),yR=["not_checked","valid","invalid","unavailable"],xR=N.enum(yR),ER=["authorization_pending","authorization_required","authorization_changed","resource_unavailable","resource_changed","verification_required","verification_unavailable"],RR=N.enum(ER),lp=N.object({revision:He,status:SR,started_at:N.string().datetime({offset:!0}),expires_at:N.string().datetime({offset:!0}),finished_at:wo,error_code:mp}).strict(),rF=N.object({expected_authorization_revision:He,expected_attempt_revision:He,select_account:N.boolean().default(!1),replace_pending:N.boolean().default(!1)}).strict(),IR=N.object({authorize_url:N.string().url(),authorization_revision:He,attempt:lp}).strict(),cF=U(IR),TR=N.object({status:gR,authorization_revision:He,account_email:N.string().max(320).nullable(),latest_attempt:lp.nullable()}).strict(),kR=N.object({account_ref:st,account_key:yn,account_display_name:xn,property_ref:st,property_key:yn,property_display_name:xn,data_stream_ref:st,data_stream_key:yn,data_stream_display_name:xn,measurement_id_display:N.string().min(1).max(40),default_uri:N.string().url().nullable(),selected_authorization_revision:He,configured_at:N.string().datetime({offset:!0}),updated_at:N.string().datetime({offset:!0})}).strict(),AR=N.object({status:xR,checked_at:wo,expires_at:wo,error_code:mp}).strict(),wR=N.enum(["oauth","verification"]),PR=N.object({measurement_id_display:N.string().min(1).max(40),stream_display_name:N.string().max(100).nullable()}).strict(),CR=N.object({status:N.enum(["pending","applied"]),applied_revision:He}).strict(),pp=N.object({capability_enabled:N.boolean(),revision:He,authorization:TR,binding_status:bR,reason:RR.nullable(),ready:N.boolean(),mode:wR.nullable(),binding:kR.nullable(),verification:AR,tracking:PR.nullable(),deployment:CR}).strict().superRefine((e,n)=>{if(!e.capability_enabled){(e.ready||e.revision!==0||e.authorization.status!=="not_authorized"||e.authorization.authorization_revision!==0||e.authorization.account_email!==null||e.authorization.latest_attempt!==null||e.binding_status!=="unconfigured"||e.reason!==null||e.mode!==null||e.binding!==null||e.tracking!==null||e.deployment.status!=="applied"||e.deployment.applied_revision!==0||e.verification.status!=="not_checked"||e.verification.checked_at!==null||e.verification.expires_at!==null||e.verification.error_code!==null)&&n.addIssue({code:N.ZodIssueCode.custom,message:"disabled GA4 capability must expose an empty state"});return}e.ready&&(e.authorization.status!=="authorized"||e.binding_status!=="configured"||e.mode!=="oauth"||e.binding===null||e.tracking===null||e.verification.status!=="valid"||e.reason!==null)&&n.addIssue({code:N.ZodIssueCode.custom,message:"ready GA4 status must be authorized, configured, and valid"})}),mF=U(pp),lF=N.object({refresh:N.union([N.boolean(),N.enum(["true","false"]).transform(e=>e==="true")]).default(!1)}).strict(),vR=N.object({property_ref:st,property_key:yn,display_name:xn}).strict(),DR=N.object({account_ref:st,account_key:yn,display_name:xn,properties:N.array(vR)}).strict(),OR=N.object({accounts:N.array(DR),returned_count:N.number().int().nonnegative(),completeness:N.literal("unknown"),authorization_revision:He}).strict(),pF=U(OR),dF=N.object({authorization_revision:N.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),NR=N.object({data_stream_ref:st,data_stream_key:yn,display_name:xn,measurement_id_display:N.string().min(1).max(40),default_uri:N.string().url().nullable(),selectable:N.boolean(),unavailable_reason:N.string().max(100).nullable()}).strict(),jR=N.object({property_ref:st,streams:N.array(NR),returned_count:N.number().int().nonnegative(),completeness:N.literal("unknown"),authorization_revision:He}).strict(),uF=U(jR),_F=N.object({property_ref:st,authorization_revision:N.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),gF=N.object({expected_revision:He,authorization_revision:He,account_ref:st,property_ref:st,data_stream_ref:st,confirm_url_mismatch:N.boolean()}).strict(),LR=N.object({applied_revision:He,idempotency_replayed:N.boolean()}).strict(),MR=pp.and(N.object({mutation:LR}).strict()),hF=U(MR);var dp=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,up="VCP_E2B_PREVIEW_PROXY_DOMAIN must be a valid hostname.";function UR(e){let n=e?.trim().toLowerCase()??"";if(!n)return null;if(n.length>253||!n.includes(".")||!n.split(".").every(s=>dp.test(s)))throw new Error(up);return n}function fF(e){let n=UR(e.proxyDomain);if(!n)return null;let s=e.sandboxId.trim();if(!dp.test(s))throw new Error("sandboxId must be a valid DNS label.");if(`${s}.${n}`.length>253)throw new Error(up);return`https://${s}.${n}/`}function yF(e){for(let n of e.targets)if(!(n.kind==="shared"?e.ledger.shared.some(i=>i.kind==="shared"&&i.target_id===n.target_id&&i.filled!==!0):e.ledger.pages.some(i=>i.omissions.some(a=>a.kind===n.kind&&a.target_id===n.target_id&&a.filled!==!0))))return{ok:!1,target_id:n.target_id};return{ok:!0}}function FR(e,n,s=e){let i=new Map(e.map(r=>[r.slug,r])),a=new Map(s.map(r=>[r.id,r])),o=new Map(e.map(r=>{let m=a.get(r.id);return m&&m.slug!==null&&m.slug!==r.slug?[m.slug,r]:null}).filter(r=>r!==null)),c=new Set(s.map(r=>r.slug).filter(r=>r!==null&&!i.has(r)));return{primaryLinks:_p(n.primaryLinks,e,i,o,c,a,"showInHeader"),footerLinks:_p(n.footerLinks,e,i,o,c,a,"showInFooter")}}function _p(e,n,s,i,a,o,c){let r=new Set,m=[];for(let[K,H]of e.entries()){let se=GR(H.href),fe=se===null?void 0:s.get(se)??i.get(se);if(se!==null&&a.has(se)&&!s.has(se)&&!i.has(se))continue;if(fe?.slug==="/"){m.push({kind:"independent",link:{...H,label:gp(H,fe,o)}});continue}if(!fe){m.push({kind:"independent",link:H});continue}if(!fe.navigation[c])continue;r.add(fe.slug);let kn=se===fe.slug?H.href:qR(H.href,fe.slug);m.push({kind:"page",page:fe,link:{...H,label:gp(H,fe,o),href:kn},index:K})}let x=m.filter(K=>K.kind==="page").sort((K,H)=>K.page.navigation.order-H.page.navigation.order||K.index-H.index),_=0,P=m.map(K=>K.kind==="page"?x[_++].link:K.link);for(let K of[...n].filter(H=>H.slug!=="/"&&H.navigation[c]).sort((H,se)=>H.navigation.order-se.navigation.order))r.has(K.slug)||P.push({label:K.title,href:K.slug});return P}function gp(e,n,s){let i=s.get(n.id);return e.label===(i?.title??n.title)?n.title:e.label}function GR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/u);return n===-1?e:e.slice(0,n)}function qR(e,n){let s=e.search(/[?#]/u);return s===-1?n:`${n}${e.slice(s)}`}function xi(e){return e.trim().normalize("NFKC").toLowerCase()}function WR(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u9996\u9875":n?.startsWith("ja")?"\u30DB\u30FC\u30E0":n?.startsWith("ko")?"\uD648":"Home"}function BR(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u66F4\u591A":n?.startsWith("ja")?"\u305D\u306E\u4ED6":n?.startsWith("ko")?"\uB354\uBCF4\uAE30":n?.startsWith("fr")?"Plus":n?.startsWith("de")?"Mehr":n?.startsWith("es")?"M\xE1s":"More"}function KR(e){return e.map(n=>n.navigation.showInHeader===!0?n:{...n,navigation:{...n.navigation,showInHeader:!0}})}function ps(e){return e.parent_page_id??null}function Ei(e,n){let s=ps(e);return s===null?!0:!n.some(i=>i.id===s)}function hp(e,n){return e.filter(s=>ps(s)===n&&s.id!==n)}function Sp(e){let n=e.filter(c=>Ei(c,e)),s=n.filter(c=>c.slug==="/"),i=n.filter(c=>c.slug!=="/"),a=[],o=new Set;for(let c of[...s,...i])if(!o.has(c.id)){a.push(c),o.add(c.id);for(let r of hp(e,c.id))o.has(r.id)||(a.push(r),o.add(r.id))}for(let c of e)o.has(c.id)||(a.push(c),o.add(c.id));return a}function zR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/);return n===-1?e:e.slice(0,n)}function HR(e,n){let s=Sp(n),i=new Map;s.forEach((c,r)=>{c.slug!==null&&!i.has(c.slug)&&i.set(c.slug,r)});let a=[],o=[];for(let c of e){let r=zR(c.href),m=r===null?void 0:i.get(r);m===void 0?o.push(c):a.push({link:c,rank:m})}return a.sort((c,r)=>c.rank-r.rank),[...a.map(c=>c.link),...o]}function $R(e){let n=e.filter(s=>Ei(s,e)).length;return{top_level_pages:n,sub_pages:e.length-n,total_pages:e.length,content_items:e.reduce((s,i)=>s+i.blocks.length,0)}}function VR(e,n={}){let s=[],i=new Map(e.map(c=>[c.id,c])),a=e.filter(c=>c.slug==="/");a.length!==1?s.push({code:"missing_home",page_id:null,message:"The structure must contain exactly one home page."}):n.expectedHomeTitle&&xi(a[0].title)!==xi(n.expectedHomeTitle)&&s.push({code:"home_renamed",page_id:a[0].id,message:`The home page must keep its fixed name '${n.expectedHomeTitle}'.`});for(let c of e){c.title.trim().length===0&&s.push({code:"empty_title",page_id:c.id,message:"Page name is empty."}),c.slug&&n.reservedSlugs?.includes(c.slug)&&s.push({code:"reserved_slug",page_id:c.id,message:`Slug '${c.slug}' is reserved by the site's applications.`});let r=ps(c);if(r===null)continue;if(c.slug==="/"){s.push({code:"home_has_parent",page_id:c.id,message:"The home page cannot have a parent."});continue}if(r===c.id){s.push({code:"self_parent",page_id:c.id,message:"A page cannot be its own parent."});continue}let m=i.get(r);if(!m){s.push({code:"parent_not_found",page_id:c.id,message:`Parent page '${r}' does not exist.`});continue}if(m.slug==="/"){s.push({code:"home_has_children",page_id:c.id,message:"The home page cannot have sub pages."});continue}ps(m)!==null&&s.push({code:"depth_exceeded",page_id:c.id,message:"At most two levels are allowed."})}let o=new Map;for(let c of e){let r=Ei(c,e)?"__top__":ps(c),m=xi(c.title);if(m.length===0)continue;let x=o.get(r)??new Map,_=x.get(m);_!==void 0&&_!==c.id?s.push({code:"duplicate_sibling_title",page_id:c.id,message:`Page name '${c.title}' is already used at the same level.`}):x.set(m,c.id),o.set(r,x)}return s}var YR=16,XR=/[ᄀ-ᅟ⺀-〾ぁ-㏿㐀-䶿一-鿿ꀀ-가-힣豈-︰--⦆¢-₩]/u;function QR(e){let n=0;for(let s of e)n+=XR.test(s)?2:1;return n}function ZR(e){let n=e.normalize("NFKC").trim().replace(/\s+/g," ").toLowerCase();return n.length>3&&n.endsWith("s")?n.slice(0,-1):n}import{z as A}from"zod";var fp=20*1024*1024,JR=fp,bp=["jpg","jpeg","png","gif","webp","bmp"],yp=["mp4","avi","mov","webm","mkv"],xp=["mp3","wav","aac","flac","ogg","wma","m4a"],Ep=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv"],Rp=[...Ep,"zip","rar","xmind","psd","ai","fig","sketch"],eI=[...bp,...yp,...xp,...Rp],Ip=["image/jpeg","image/png","image/gif","image/webp","image/bmp"],Tp=["video/mp4","video/x-msvideo","video/quicktime","video/webm","video/x-matroska"],kp=["audio/mpeg","audio/wav","audio/x-wav","audio/vnd.wave","audio/aac","audio/flac","audio/x-flac","audio/ogg","audio/x-ms-wma","audio/mp4","audio/x-m4a"],tI=[...Ip,...Tp,...kp],Ap=A.enum(["image","video","audio","document","file"]),wp=A.enum(["external","ai_generated","unsplash"]),Po=A.object({resource_id:A.string().min(1),name:A.string().min(1).max(255),url:A.string().url(),thumbnail_url:A.union([A.string().url(),A.literal("")]),mime_type:A.string().trim().min(3).max(127),size:A.number().int().nonnegative(),width:A.number().int().positive().nullable(),height:A.number().int().positive().nullable(),source:wp,created_at:A.string().min(1).nullable()}),nI=A.object({page:A.coerce.number().int().min(1).default(1),page_size:A.coerce.number().int().min(1).max(100).default(24),keyword:A.string().trim().max(100).optional(),file_type:Ap.default("image")}),sI=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(Po),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative()})}),iI=A.object({code:A.literal(0),message:A.string(),data:Po}),Co=4,aI=A.object({pageName:A.string().trim().min(1).max(200),pageType:A.enum(["landing_page","general_page","detail_page","list_page","category_page","tag_page","author_page","search_page","date_page"]),sectionTitle:A.string(),nearbyTitle:A.string(),nearbyBody:A.string(),prompt:A.string().trim().min(1).max(2e3),aspectRatio:A.string().regex(/^[1-9]\d*:[1-9]\d*$/)}),Pp=A.object({index:A.number().int().min(0).max(Co-1),ok:A.literal(!0),url:A.string().regex(/^data:image\/(?:png|jpeg|gif|webp|bmp);base64,[A-Za-z0-9+/]+={0,2}$/)}),oI=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(Pp).min(1).max(Co)})}),Cp=A.object({provider_id:A.string().min(1),url:A.string().url(),thumbnail_url:A.string().url(),width:A.number().int().positive(),height:A.number().int().positive(),alt:A.string(),photographer_name:A.string().min(1),photographer_url:A.string().url(),photo_url:A.string().url(),download_location:A.string().url(),dominant_color:A.string().nullable()}),rI=A.object({query:A.string().trim().min(1).max(100),page:A.coerce.number().int().min(1).default(1),page_size:A.coerce.number().int().min(1).max(30).default(18),orientation:A.enum(["landscape","portrait","squarish"]).optional()}),cI=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(Cp),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative(),total_pages:A.number().int().nonnegative()})}),vp=A.string().url().refine(uI,{message:"download_location must be an official Unsplash download URL"}),mI=A.object({download_location:vp}),lI=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})}),pI=A.object({source_id:A.number().int().positive(),source_title:A.string().min(1).max(255),source_url:Kt,resource_id:A.number().int().positive()}),dI=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})});function uI(e){if(!URL.canParse(e))return!1;let n=new URL(e);return n.protocol==="https:"&&n.hostname==="api.unsplash.com"&&n.username===""&&n.password===""&&n.port===""&&n.hash===""&&/^\/photos\/[^/]+\/download$/.test(n.pathname)}import{z as le}from"zod";var _I=le.object({colorSeeds:le.object({primary:le.string().min(1).max(40),accent:le.string().min(1).max(40),foreground:le.string().min(1).max(40).optional()}).strict().optional(),surfaceMode:le.enum(["light","dark"]).optional(),fonts:le.object({heading:le.string().min(1).max(60),body:le.string().min(1).max(60)}).strict().optional(),weightStyle:Ke.optional()}).strict().refine(e=>e.colorSeeds!==void 0||e.surfaceMode!==void 0||e.fonts!==void 0||e.weightStyle!==void 0,{message:"colorSeeds, surfaceMode, fonts, or weightStyle is required"}),gI=le.object({ok:le.literal(!0),design_plan_version:le.number().int().positive().optional(),snapshot_id:I,site_design_context:le.lazy(()=>Ri).optional(),changed_files:le.array(le.string().min(1)).optional()}),hI=le.object({snapshot_id:I,color_seeds:le.object({primary:le.string(),accent:le.string(),foreground:le.string().optional()}).nullable(),surface_mode:le.enum(["light","dark"]).nullable(),fonts:le.object({heading:le.string(),body:le.string()}).nullable(),palette_inputs_present:le.boolean(),palette_inputs:La.nullable(),notes:le.array(le.string()).nullable(),weight_style:Ke.nullable().default(null),source:le.enum(["globals_css","design_plan_archive"])});import{z as w}from"zod";var ye=w.string().min(1).max(100),Do=w.enum(["page","anchor","external","email","phone","file","group"]);function SI(e){if(!e||e.trim()!==e||/[\u0000-\u001f\u007f\\]/u.test(e))return!1;if(e.startsWith("/")&&!e.startsWith("//")||/^#[^\s]*$/u.test(e)||/^(mailto:|tel:)[^\s]+$/iu.test(e))return!0;try{let n=new URL(e);return(n.protocol==="http:"||n.protocol==="https:")&&!n.username&&!n.password}catch{return!1}}var fI=w.string().max(2048).refine(SI,"Invalid navigation destination"),Oo=w.string().trim().min(1).max(255),No=w.enum(["link","cta"]).nullable(),Dp=w.lazy(()=>w.object({id:ye,group_id:ye,parent_id:ye.nullable(),sort_order:w.number().int().nonnegative(),label:w.string(),href:w.string().nullable(),target_type:Do,enabled:w.boolean(),effective_visible:w.boolean(),open_in_new:w.boolean(),nofollow:w.boolean(),role:No,link_binding:w.object({kind:w.enum(["custom","cms_page","file"]),page_id:ye.nullable()}),children:w.array(Dp)})),bI=w.object({id:ye,name:w.string(),description:w.string(),is_default:w.boolean(),can_delete:w.boolean(),delete_block_reason:w.string().nullable(),items:w.array(Dp)}),yI=w.object({site_id:w.string().min(1),default_group_id:ye.nullable(),groups:w.array(bI),limits:w.object({max_depth:w.number().int().positive(),max_items:w.number().int().positive()})}),jF=w.object({data:yI}),Op=w.object({name:Oo,description:w.string().max(2e3).optional()}).strict(),xI=Op.partial().refine(e=>Object.keys(e).length>0,"At least one field is required"),LF=w.object({group_id:ye}).strict(),Np={label:Oo,target_type:Do,href:fI.nullable().optional(),enabled:w.boolean().optional(),open_in_new:w.boolean().optional(),nofollow:w.boolean().optional(),role:No.optional()},jp=w.object({group_id:ye,parent_id:ye.nullable().optional(),...Np}).strict().superRefine((e,n)=>{e.target_type!=="group"&&!e.href&&n.addIssue({code:"custom",path:["href"],message:"Link destination is required"}),e.target_type==="group"&&e.href&&n.addIssue({code:"custom",path:["href"],message:"Groups have no destination"})}),EI=w.object({...Np,link_mode:w.literal("custom").optional()}).partial().strict().refine(e=>Object.keys(e).length>0,"At least one field is required"),RI=w.object({group_id:ye,parent_id:ye.nullable(),before_id:ye.nullable().optional()}).strict(),vo=w.lazy(()=>w.object({id:ye.nullable(),label:w.string().max(255),href:w.string().max(2048).nullable(),target_type:Do,enabled:w.boolean(),open_in_new:w.boolean(),nofollow:w.boolean(),role:No,children:w.array(vo)}).strict()),MF=w.object({group_id:ye.nullable(),group_name:Oo.optional(),baseline:w.array(vo),items:w.array(vo)}).strict().superRefine((e,n)=>{e.group_id===null&&e.items.length>0&&!e.group_name&&n.addIssue({code:"custom",path:["group_name"],message:"New navigation group name is required"});for(let s of["baseline","items"]){let i=new Set,a=0,o=(c,r,m)=>{for(let[x,_]of c.entries()){let P=[...m,x];if(a++,s==="items"&&(a>1e3||r>20)){n.addIssue({code:"custom",path:P,message:"Navigation tree limit exceeded"});return}if((s==="baseline"&&_.id===null||_.id!==null&&i.has(_.id))&&n.addIssue({code:"custom",path:[...P,"id"],message:"Invalid or duplicate navigation ID"}),_.id!==null&&i.add(_.id),s==="items"){let K=jp.safeParse({group_id:e.group_id??"new",label:_.label,href:_.href,target_type:_.target_type,enabled:_.enabled,open_in_new:_.open_in_new,nofollow:_.nofollow,role:_.role});if(!K.success)for(let H of K.error.issues)n.addIssue({code:"custom",path:[...P,...H.path.filter(se=>typeof se=="string"||typeof se=="number")],message:H.message})}o(_.children,r+1,[...P,"children"])}};o(e[s],1,[s])}}),II=w.object({cms_bound:w.boolean(),bound_nav_keys:w.array(w.string()).optional(),analyzed_snapshot_id:w.string().nullable().optional(),cms_driven:w.boolean(),supports_groups:w.boolean(),supports_nested_groups:w.boolean(),supports_link_attributes:w.boolean(),requires_agent:w.boolean(),reasons:w.array(w.string())}),UF=w.object({data:II}),FF=w.discriminatedUnion("action",[w.object({action:w.literal("create_group"),values:Op}).strict(),w.object({action:w.literal("update_group"),id:ye,values:xI}).strict(),w.object({action:w.literal("delete_group"),id:ye}).strict(),w.object({action:w.literal("set_default_group"),group_id:ye}).strict(),w.object({action:w.literal("create_item"),values:jp}).strict(),w.object({action:w.literal("update_item"),id:ye,values:EI}).strict(),w.object({action:w.literal("delete_item"),id:ye,cascade:w.boolean().optional()}).strict(),w.object({action:w.literal("move_item"),id:ye,values:RI}).strict()]);import{z as pe}from"zod";var jo=pe.enum(["products","cases","guides","documents","company"]),TI=pe.enum(["source_unreachable","content_mojibake","min_fields_unmet","document_no_file_reference","document_file_unavailable","media_ingest_failed","app_unavailable","write_failed","kind_input_unavailable","kind_uncertain","kind_service_unavailable","kind_budget_exhausted"]),Rt=pe.number().int().nonnegative(),kI=pe.discriminatedUnion("status",[pe.object({collection:jo,status:pe.literal("processing")}).strict(),pe.object({collection:jo,status:pe.enum(["imported","partial","failed"]),imported:Rt,exception:Rt}).strict()]),Lp=pe.enum(["legacy_domain_not_routed","site_context_missing","site_rules_limit_exceeded","site_rules_not_served"]),AI=pe.enum(["target_page_unpublished","redirect_target_missing","redirect_write_failed",...Lp.options]),wI=pe.discriminatedUnion("status",[pe.object({status:pe.literal("processing")}).strict(),pe.object({status:pe.literal("unavailable")}).strict(),pe.object({status:pe.literal("ready"),site_reason:Lp.nullable(),same_path:Rt,active:Rt,exception:Rt,exceptions:pe.array(pe.object({path:pe.string().regex(/^\/[^?#]*$/),reason_code:AI}))})]),WF=pe.object({overall_status:pe.enum(["moving","completed","disabled","failed"]),by_collection:pe.array(kI),media:pe.object({image:Rt,video:Rt,audio:Rt,file:Rt}),exceptions:pe.array(pe.object({collection:jo.nullable(),path:pe.string().regex(/^\/[^?#]*$/),reason_code:TI})),redirects:wI.nullable().optional()});import{z as ds}from"zod";var zF=ds.strictObject({display_name:ds.string().nullable(),account_category:ds.number().int().nullable()}),HF=ds.strictObject({redirect_url:ds.url({protocol:/^https$/}).refine(e=>{try{let n=new URL(e);return!n.username&&!n.password}catch{return!1}})});import{z as O}from"zod";var PI=O.enum(["not_published","waiting_domain","not_started","creating","running","ready","failed","unavailable"]),CI=O.object({code:O.string().min(1),message:O.string().min(1),retryable:O.boolean()}).strict(),vI=O.object({phase:PI,runId:O.uuid().nullable(),progress:O.number().min(0).max(1).nullable(),hasExecutionWarning:O.boolean(),error:CI.nullable()}).strict(),YF=O.object({code:O.literal(0),message:O.literal("ok"),data:vI}).strict(),DI=["performance","experience","index","ai","compliance"],Up=O.enum(DI),OI=O.object({key:Up,title:O.string(),value:O.string(),providerLabel:O.string().nullable(),description:O.string()}).strict(),NI=O.object({key:O.string(),label:O.string(),description:O.string(),value:O.union([O.string(),O.number(),O.null()]),displayValue:O.string(),progress:O.number().min(0).max(1).nullable()}).strict(),jI=O.object({key:Up,title:O.string(),badge:O.string(),metrics:O.array(NI)}).strict(),LI=O.object({cards:O.array(OI).length(5).refine(e=>new Set(e.map(n=>n.key)).size===5,"Each health card key must occur exactly once"),details:O.array(jI).length(5).refine(e=>new Set(e.map(n=>n.key)).size===5,"Each health detail key must occur exactly once")}).strict(),XF=O.object({code:O.literal(0),message:O.literal("ok"),data:LI}).strict(),QF=O.object({}).strict(),MI=O.string().regex(/^\d{1,18}$/),Mp=O.object({checkCode:O.string().regex(/^[A-Za-z][A-Za-z0-9_.-]{0,127}$/),name:O.string().min(1).max(128),execution:O.enum(["queued","running","completed","failed"]),conclusion:O.enum(["passed","failed","unknown","unavailable"])}).strict(),UI=O.object({total:O.number().int().nonnegative(),passed:O.number().int().nonnegative(),failed:O.number().int().nonnegative(),unknown:O.number().int().nonnegative(),unavailable:O.number().int().nonnegative(),executionFailed:O.number().int().nonnegative()}).strict(),Lo={id:MI,runId:O.uuid(),createdAt:O.iso.datetime()},ZF=O.discriminatedUnion("type",[O.object({...Lo,type:O.literal("accepted"),data:O.object({runId:O.uuid(),checks:O.array(Mp).min(1).max(1e3)}).strict()}).strict(),O.object({...Lo,type:O.literal("check.updated"),data:Mp}).strict(),O.object({...Lo,type:O.enum(["progress","completed","failed"]),data:O.object({status:O.enum(["queued","running","completed","failed"]).optional(),summary:UI}).strict()}).strict()]),JF=O.object({code:O.literal("INITIAL_REVIEW_STREAM_INTERRUPTED"),retryable:O.literal(!0)}).strict();var Fo=t.object({heading:t.string().min(1).max(160).optional(),body:t.string().min(1).max(160).optional(),paletteIntent:t.string().min(1).max(400).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),density:t.enum(["compact","comfortable","airy","editorial"]).optional(),motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),themeId:t.string().min(1).max(60).optional(),themeDescription:t.string().min(1).max(400).optional(),aestheticNote:t.string().min(1).max(300).optional(),weightStyle:Ke.optional()}),Mo=t.enum(["material","reference","brief","industry"]),FI=t.object({market:t.object({value:t.string().min(1).max(200),source:Mo}),customer:t.object({value:t.string().min(1).max(200),source:Mo}),purpose:t.object({options:t.array(t.string().min(1).max(60)).min(2).max(4),selected:t.string().min(1).max(60),source:Mo})}),GI=t.enum(["text-options","motion-slider","positioning"]),Go=t.enum(["none","subtle","moderate","expressive"]),qI=t.enum(["compact","comfortable","airy","editorial"]),WI=Go,Kp=t.object({skill_name:t.string().min(1),rationale:t.string().min(4).max(200),confidence:t.enum(["high","medium","low"]).optional(),displayName:t.object({zh:t.string().min(1),en:t.string().min(1)}).partial().optional()}),BI=t.object({value:t.string(),label:t.string(),desc:t.string().optional(),impact:t.string().optional(),isRecommended:t.boolean().optional(),preselect:t.boolean().optional(),visualHints:Fo.optional(),conversionHints:Gt.optional()}),KI=t.object({id:t.string(),type:GI,question:t.string(),tag:t.string(),aiThinking:t.string(),options:t.array(BI),source:t.enum(["ai-detected","always-ask"]),sourceDetail:t.string(),positioning:FI.optional()}),qo=t.object({questions:t.array(KI).min(1).max(6)}),wG=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Zt,brief:t.string().min(20).max(1e3),site_default_locale:Te.optional(),owner_locale:Te.optional(),input_context:t.object({facts:t.array(bs).max(120),conflicts:t.array(xs).max(20),reference:ys.optional(),sources:t.array(t.object({type:Oi,title:t.string().max(120).optional(),status:Ni})).max(16).optional()}).optional()}),zp=t.enum(["model_schema_invalid","provider_rate_limited","provider_unavailable","aborted","unknown"]),PG=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Kp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:zp.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),at:t.string().min(1)})]),CG="SITE_PLANNING_INPUT_FROZEN",vG="SITE_PLANNING_LOCKED",DG="SITE_STRUCTURE_CONFIRMATION_REQUIRED",OG="SITE_STRUCTURE_CONFIRMATION_STALE",NG="SITE_SITEMAP_DRAFT_STALE",jG="SITE_SITEMAP_DRAFT_OPERATION_MISMATCH",Fp="SITE_STRUCTURE_INVALID",LG=t.object({tenant_id:t.string().min(1),name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),MG=t.object({name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),UG=t.object({name:t.string().min(1).max(120)}),FG=t.object({name:t.string().min(1).max(120),default_locale:Te.optional()}),GG=t.object({body:t.string().min(20).max(1e3)}),qG=t.object({body:t.string().min(20).max(1e3)}),Wo=t.string().url().refine(e=>{try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}},{message:"URL must use http or https protocol"}),WG=t.object({tenant_id:t.string().min(1),site_id:k.optional(),site_url:Wo.optional(),site_name:t.string().trim().min(1).max(255).optional()}),BG=U(Br),KG=U(Kr),zG=U(zr),HG=U(ac),$G=U(oc),VG=U(rc),YG=U(mc),XG=U(lc),QG=U(pc),ZG=U(t.object({site_id:k,site_url:Wo.nullable()})),Ut=t.object({id:k,tenant_id:t.string().min(1),name:t.string().min(1),slug:t.string().min(1),status:ua,deployment_status:_a,archived_at:t.string().min(1).nullable(),current_sitemap_id:we.nullable(),confirmed_sitemap_id:we.nullable().optional(),confirmed_sitemap_version:t.number().int().positive().nullable().optional(),structure_confirmed_at:t.string().min(1).nullable().optional(),migration_content_requested:t.boolean().optional(),current_snapshot_id:I.nullable(),published_deployment_id:dt.nullable().optional(),deployed_url:t.string().url().nullable(),default_locale:Te,owner_locale:Te.optional(),cms_site_id:Ts.nullable().optional(),cms_site_url:Wo.nullable().optional(),parent_site_id:k.nullable().optional(),mount_path:t.string().min(1).nullable().optional(),schema_version:t.literal(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),Bo=t.object({id:Zt,tenant_id:t.string().min(1),site_id:k,body:t.string().min(1),source:t.enum(["user","import","system"]),created_at:t.string().min(1),updated_at:t.string().min(1)}),JG=t.object({site:Ut,brief:Bo,next_step:t.literal("clarify")}),eq=t.object({site:Ut,brief:Bo}),tq=t.object({brief:Bo}),zI=t.enum(["queued","running","succeeded","failed","cancelled"]),Hp=t.enum(["clarify","sitemap","workspace"]),$p=t.enum(["clarify","sitemap","initial_generation","iteration","landing_page","fill_in"]),Vp=t.enum(["clarify","sitemap","workspace","summarize"]),it=t.object({id:V,tenant_id:t.string().min(1),site_id:k,agent_type:Hp,run_kind:$p,status:zI,model_route:Vp,started_at:t.string().min(1).nullable(),finished_at:t.string().min(1).nullable(),error_code:t.string().min(1).nullable(),created_at:t.string().min(1),thread_id:at.nullable().optional()}),nq=t.object({agent_run:it}).strict(),HI=t.enum(["workspace","landing_page","external"]),$I=t.enum(["user","background"]),Yp=t.enum(["active","archived"]),Ai=t.object({id:at,tenant_id:t.string().min(1),site_id:k,kind:HI,origin:$I,subject_key:t.string().min(1).max(200),title:t.string().min(1).max(200),status:Yp,external_thread_id:t.string().min(1).max(200).nullable(),last_run_id:V.nullable(),last_activity_at:t.string().min(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),sq=t.object({agent_run:it,thread:Ai.nullable()}),iq=t.object({run_id:V.optional(),site_id:k,agent_type:Hp,run_kind:$p.optional(),model_route:Vp,input:t.record(t.string(),t.unknown()).optional()}).superRefine((e,n)=>{us(e.input)&&n.addIssue({code:"custom",path:["input"],message:"Agent run input must not contain secrets"})}),aq=t.object({agent_run:it,next_step:t.literal("stream_events")}),Xp=t.enum(["draft","candidate","deleting","current","failed"]),It=t.object({id:I,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:et.nullable().optional(),reason:t.enum(["initial_generation","workspace_edit","pre_deploy","manual_save","rollback","template_upgrade","subsite_clone"]),status:Xp,created_at:t.string().min(1)}),oq=t.object({snapshot_id:I,creation_key:t.string().min(1),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:et.optional(),reason:It.shape.reason,status:t.enum(["draft","candidate","current","failed"]).default("candidate"),source_run_id:V.optional()}),rq=t.object({site:Ut,snapshot:It,next_step:t.literal("workspace")}),cq=t.object({expected_manifest_hash:It.shape.manifest_hash,manifest_hash:It.shape.manifest_hash,object_key:It.shape.object_key}).strict(),mq=t.union([t.object({base_snapshot_id:I.nullable(),source_run_id:V.optional(),page_template_advisories:t.array(Cn).optional()}).strict(),t.object({skip_base_check:t.literal(!0)}).strict()]),VI=t.object({site:Ut,snapshot:It,next_step:t.literal("workspace")}),lq=t.object({snapshot:It}),pq=t.object({status:t.literal("deleting"),snapshot_id:I,object_key:t.string().min(1)}),dq=t.object({status:t.literal("deleted"),snapshot_id:I}),wi=t.object({id:sr,tenant_id:t.string().min(1),site_id:k,snapshot_id:I,version:t.number().int().positive(),accepted_commit:t.string().min(1),source_run_id:V.nullable(),created_at:t.string().min(1)}),YI=wi.extend({reason:It.shape.reason,status:Xp}),uq=t.object({accepted_commit:t.string().min(1),source_run_id:V.optional()}),_q=t.object({site_version:wi,next_step:t.literal("workspace")}),gq=t.object({owner_id:t.string().min(1)}).strict(),hq=t.discriminatedUnion("acquired",[t.object({acquired:t.literal(!0)}).strict(),t.object({acquired:t.literal(!1)}).strict()]),Sq=t.object({owner_id:t.string().min(1)}).strict(),fq=t.object({released:t.literal(!0)}).strict(),bq="TEMPLATE_UPGRADE_LOCK_LOST",yq=t.object({base_snapshot_id:I,accepted_commit:wi.shape.accepted_commit,owner_id:t.string().min(1)}).strict(),xq=VI.strict(),Eq=t.object({site_versions:t.array(YI)}),Rq=t.object({site:Ut,snapshot:It,site_version:wi,next_step:t.literal("workspace")}),Iq=t.object({snapshot_id:I,force_rehydrate:t.boolean().optional(),recovery_required:t.boolean().optional(),required_cms_site_id:Ts.optional()}),XI=t.discriminatedUnion("status",[t.object({status:t.literal("ready"),snapshot_id:I,preview_url:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({status:t.literal("failed"),code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),snapshot_id:I.optional(),code_error:Gi.optional()})]),Tq=t.object({tenant_id:t.string().min(1),site_id:k,snapshot_id:I,cms_site_id:Ts.optional()}).strict(),kq=XI,Ko=t.enum(en),Qp=t.enum(["quality_check","publish"]),Lt=t.object({id:dt,tenant_id:t.string().min(1),site_id:k,snapshot_id:I,type:Qp.default("publish"),version:t.number().int().positive(),status:Ko,provider:t.enum(["cloudflare"]),url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),Aq=t.object({tenant_id:t.string().min(1),site_id:k,expected_snapshot_id:I}).strict(),wq=t.object({deployment:Lt}),Pq=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:dt}).strict(),Cq=t.object({deployment:Lt}),vq=t.object({}).strict(),Dq=t.object({snapshot_id:I.optional()}).strict(),QI=t.object({deployment:Lt}),Oq=U(QI),Nq=t.object({deployment:Lt.nullable()}),jq=t.object({deployment:Lt}),Gp=t.object({id:dt,type:Qp.default("publish"),status:Ko,url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable()}),ZI=t.object({current:Gp.nullable(),latest_released:Gp.nullable()}),Lq=U(ZI),JI=t.enum(["deployment.snapshot","deployment.status.changed","deployment.finished","deployment.failed","deployment.realtime.recovered","server.error"]),En=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,deployment_id:dt,seq:t.number().int().positive(),sent_at:t.string().min(1)}),Ii=t.object({deployment:Lt,steps:Jc.default([])}),Mq=t.discriminatedUnion("type",[En.extend({type:t.literal("deployment.snapshot"),payload:Ii}),En.extend({type:t.literal("deployment.status.changed"),payload:Ii}),En.extend({type:t.literal("deployment.finished"),payload:Ii}),En.extend({type:t.literal("deployment.failed"),payload:Ii}),En.extend({type:t.literal("deployment.realtime.recovered"),payload:t.object({action:t.literal("refresh")})}),En.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})})]),Uq=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:dt,status:Ko,updated_at:t.string().min(1)}),eT="vcp:deployments",Fq={path:"/v1/sites/:site_id/deployments/:deployment_id/socket",redis_channel:eT,outbound_message_schema:"DeploymentWsServerMessageSchema",message_types:[...JI.options]},tT=t.object({error:t.object({code:t.string().min(1),message:t.string().min(1),details:t.unknown().optional(),request_id:t.string().min(1).optional(),retryable:t.boolean().default(!1)})}),Gq=t.object({error:tT.shape.error.extend({code:t.literal("AGENT_RUN_IN_FLIGHT"),details:t.object({code:t.literal("AGENT_RUN_IN_FLIGHT"),message:t.string().min(1),agent_run:it})})}),qq=t.object({colors:t.record(t.string(),t.string()).default({}),typography:t.record(t.string(),t.string()).default({}),spacing:t.record(t.string(),t.string()).default({}),motion:t.record(t.string(),t.string()).default({})}),nT=t.object({theme_id:t.string().min(1),paletteIntent:t.string().min(1),tone:t.string().min(1),mediaMood:t.string().min(1),motionLevel:Go.optional(),userVisualHints:Fo.optional()}),sT=t.object({key:t.string().min(1).max(64).optional(),question:t.string().min(1),answer:t.string().min(1)}),Wq=t.object({query:t.string().min(1),keywords:t.array(t.string()).default([]),orientation:t.enum(["landscape","portrait","square"]).optional(),role:t.enum(["hero","section","card","gallery","testimonial","decorative"]),altHint:t.string().min(1)}),Bq=t.object({id:t.string().min(1),role:t.enum(["site_background","nav_background","footer_background"]),query:t.string().min(1),keywords:t.array(t.string()).default([]),treatment:t.enum(["cover","fixed-cover","subtle-texture"]),altHint:t.string().optional()}),iT=t.object({provider:t.enum(["unsplash","pexels"]),providerLabel:t.enum(["Unsplash","Pexels"]),providerHref:t.string().url(),photoHref:t.string().url().optional(),photographerName:t.string().optional(),photographerHref:t.string().url().optional(),requiresAttribution:t.boolean()}),Kq=t.object({src:t.string().min(1),alt:t.string().min(1),width:t.number().int().positive().optional(),height:t.number().int().positive().optional(),provider:t.enum(["unsplash","pexels","placeholder"]).optional(),providerId:t.string().optional(),photoUrl:t.string().url().optional(),photographer:t.string().optional(),photographerUrl:t.string().url().optional(),credit:t.string().optional(),dominantColor:t.string().optional(),attribution:iT.optional()}),aT=t.enum(["system_recommended","user_picked","user_picked_extended","deterministic_fallback"]),Rn=t.object({id:t.string().min(1),name:t.string().min(1),category:t.literal("page-generation"),version:t.string().min(1).optional(),reason:t.string().min(1).max(200),source:aT.default("system_recommended")}),oe=t.string().min(1).max(2e3),qp=t.string().min(1).max(120),Ri=t.object({visualDirection:oe,brandFeeling:oe,paletteIntent:oe,typographyIntent:oe,density:qI,motionLevel:WI,motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),mediaStrategy:oe,compositionRules:t.array(oe).max(20),avoidPatterns:t.array(oe).max(20),fonts:t.object({heading:t.string().min(1),body:t.string().min(1)}).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),weightStyle:Ke.optional()}),zo=160,Zp=t.object({routeGoal:oe,narrativeArc:oe,firstViewportIntent:oe,visualContinuity:oe,sectionRhythm:oe,avoidPatterns:t.array(oe).max(20),displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(zo).optional(),metaTitle:t.string().min(1).max(120).optional(),metaDescription:t.string().min(1).max(320).optional(),primaryKeyword:t.string().min(1).max(160).optional(),longTailKeywords:t.array(t.string().min(1).max(160)).max(3).optional()}),Jp=t.enum(["model_call","validation","repair","preview","worker_group"]),Mt=t.enum(["generating","generating_design_plan","checking_quality","updating_design_memory"]),ed=t.object({sectionRole:oe,contentIntent:oe,layoutIntent:oe,visualIntent:oe,mediaIntent:oe,motionIntent:oe,interaction:fs.optional(),copyTone:oe,displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(zo).optional(),ctaIntent:oe.optional(),continuityWithPrevious:oe.optional(),avoidRepeating:t.array(oe).max(20).optional(),industryRecipeRefs:t.array(qp).max(12).optional(),templateRecipeRefs:t.array(qp).max(12).optional()}),td=t.object({siteName:t.string().min(1).max(120),tagline:t.string().min(1).max(200).optional(),primaryCta:t.object({label:t.string().min(1).max(60),target:t.string().min(1).max(200)}).optional(),trustSignals:t.array(t.string().min(1).max(60)).max(6).optional(),industry:t.string().min(1).max(40).optional()}),oT=t.enum(["solid","floating"]),rT=t.enum(["background","card","primary","frosted"]),cT=t.enum(["sticky","hide-on-scroll","static"]),mT=t.enum(["bar","island"]),lT=t.object({variant:oT,surface:rT.optional(),behavior:cT.optional(),shape:mT.optional()}),pT=t.object({form:oe,layoutIntent:oe,scrollBehavior:oe,shell:lT.optional(),avoidPatterns:t.array(oe).max(10).optional()}),dT=t.enum(["background","card","primary","inverse"]),uT=t.object({surface:dT}),_T=t.object({form:oe,composition:oe,shell:uT.optional(),avoidPatterns:t.array(oe).max(10).optional()}),gT=t.object({pattern:oe,intent:oe}),nd=t.object({header:pT,footer:_T,mobileNav:gT}),sd=t.enum(["top","below-hero","footer","none"]),id=t.object({schemaVersion:t.literal(1).default(1),siteDesignContext:Ri,routeCards:t.record(t.string().min(1),Zp),blockContexts:t.record(t.string().min(1),ed),selectedSkillPacks:t.array(Rn).max(3).optional(),branding:td.optional(),chromeDesign:nd.optional(),breadcrumbPlacement:sd.optional()}),zq=t.object({siteDesignContext:Ri.omit({imagePalette:!0}).optional(),routeCards:t.record(t.string().min(1),Zp).optional(),blockContexts:t.record(t.string().min(1),ed.extend({interaction:fs.nullable().optional()})).optional(),branding:td.optional(),chromeDesign:nd.optional()}),We=t.string().trim().min(1),Ho=t.object({id:We,label:t.string().trim().min(1),type:t.string(),variant:t.string().optional(),order:t.number(),props:t.record(t.string(),t.unknown()),meta:t.object({aiGenerated:t.boolean(),userEdited:t.boolean(),lastEditedAt:t.string(),lastEditedBy:t.enum(["ai","user"]),userInstruction:t.string().optional()}).optional()}).strict(),$o=t.string().regex(Gn,"Page slug must be '/' or a lowercase ASCII kebab-case absolute path."),hT=new RegExp(`^/(?:${an}(?:/${an})*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$`),ST=/^(?:#[^\s]*|[a-z][a-z0-9+.-]*:[^\s]+|\/\/[^\s]+)$/i,fT=t.union([t.string().regex(hT),t.string().regex(ST)]),Wp=t.object({label:t.string(),href:fT}).passthrough(),bT=t.object({primaryLinks:t.array(Wp),footerLinks:t.array(Wp)}),ad=t.object({showInHeader:t.boolean(),showInFooter:t.boolean(),order:t.number()}).strict(),Vo=t.object({id:We,slug:$o,title:t.string().trim().min(1),blocks:t.array(Ho).min(1),navigation:ad,parent_page_id:We.nullable().optional()}).strict(),yT=Ho.extend({type:t.string().nullable()}).strict(),xT=Vo.extend({slug:$o.nullable(),navigation:ad.extend({showInHeader:t.boolean().nullable(),showInFooter:t.boolean().nullable()}).strict(),blocks:t.array(yT).min(1)}).strict(),ET=Ho.extend({id:t.string()}),RT=Vo.omit({parent_page_id:!0}).extend({id:t.string(),slug:t.string().min(1),blocks:t.array(ET).min(1),parent_page_id:t.string().nullable().optional()}),Bp=t.object({label:t.string(),href:t.string().min(1)}),IT=t.object({primaryLinks:t.array(Bp),footerLinks:t.array(Bp)}),TT=t.discriminatedUnion("kind",[t.object({kind:t.literal("brief_clarify"),brief_id:Zt,answer_ids:t.array(t.string().min(1)).max(10)}).strict(),t.object({kind:t.literal("step5_strategy"),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/)}).strict()]),Ti=t.object({site_name:t.string().min(1).max(80).optional(),version:t.number().int().positive(),pages:t.array(Vo).min(1),navigation:bT,integrations:t.object({cms:t.unknown().optional(),analytics:t.unknown().optional()}).optional(),meta:t.object({generatedAt:t.string(),generatedBy:t.literal("sitemap-agent"),source_brief_id:t.string().optional(),source_answer_ids:t.array(t.string()).optional(),source:TT.optional()}),skillSelection:Rn,visualTheme:nT.optional(),userChoices:t.array(sT).optional(),confirmedChoices:t.object({conversion:Gt.optional()}).optional(),seoKeywords:t.array(jn).min(1).optional()}).strict(),In=Ti.superRefine((e,n)=>{od(e.pages,n)}),bn=Ti.extend({pages:t.array(xT).min(1)}).strict().superRefine((e,n)=>{od(e.pages,n)}),kT=t.enum(["slug","showInHeader","showInFooter"]),AT=t.object({page_id:We,fields:t.array(kT).min(1).max(3)}).strict(),wT=t.object({page_id:We,block_id:We,fields:t.tuple([t.literal("type")])}).strict(),PT=100,CT=500,vT=t.object({pages:t.array(AT).max(PT),blocks:t.array(wT).max(CT)}).strict().superRefine((e,n)=>{let s=new Set;e.pages.forEach((a,o)=>{s.has(a.page_id)&&n.addIssue({code:"custom",path:["pages",o,"page_id"],message:`Duplicate page target '${a.page_id}'.`}),s.add(a.page_id),new Set(a.fields).size!==a.fields.length&&n.addIssue({code:"custom",path:["pages",o,"fields"],message:"Page target fields must be unique."})});let i=new Set;e.blocks.forEach((a,o)=>{let c=`${a.page_id}\0${a.block_id}`;i.has(c)&&n.addIssue({code:"custom",path:["blocks",o],message:`Duplicate block target '${a.page_id}/${a.block_id}'.`}),i.add(c)})}),Hq=t.object({sitemap:bn,targets:vT,reserved_slugs:t.array($o).optional()}).strict(),$q=t.object({sitemap:In}).strict();function od(e,n){let s=new Map,i=new Map,a=new Map,o=0;e.forEach((m,x)=>{let _=s.get(m.id);if(_!==void 0?n.addIssue({code:"custom",path:["pages",x,"id"],message:`Duplicate page id '${m.id}' (first used at pages.${_}.id).`}):s.set(m.id,x),m.blocks.forEach((K,H)=>{let se=i.get(K.id);se!==void 0?n.addIssue({code:"custom",path:["pages",x,"blocks",H,"id"],message:`Duplicate block id '${K.id}' (first used at pages.${se.pageIndex}.blocks.${se.blockIndex}.id).`}):i.set(K.id,{pageIndex:x,blockIndex:H})}),m.slug===null)return;m.slug==="/"&&(o+=1);let P=a.get(m.slug);P!==void 0?n.addIssue({code:"custom",path:["pages",x,"slug"],message:`Duplicate page slug '${m.slug}' (first used at pages.${P}.slug).`}):a.set(m.slug,x)}),(o!==1||e[0]?.slug!=="/")&&n.addIssue({code:"custom",path:["pages"],message:"Sitemap must contain exactly one home page at pages[0] with slug '/'.",params:{errorCode:Fp}});let c=new Map(e.map((m,x)=>[m.id,{page:m,index:x}])),r=(m,x)=>n.addIssue({code:"custom",path:m,message:x,params:{errorCode:Fp}});e.forEach((m,x)=>{let _=m.parent_page_id??null;if(_===null)return;let P=["pages",x,"parent_page_id"];if(m.slug==="/"){r(P,"The home page cannot have a parent.");return}if(_===m.id){r(P,`Page '${m.id}' cannot be its own parent.`);return}let K=c.get(_);if(!K){r(P,`Parent page '${_}' does not exist.`);return}if(K.page.slug==="/"){r(P,"The home page cannot have sub pages.");return}(K.page.parent_page_id??null)!==null&&r(P,`Sitemap allows at most two levels; parent '${_}' must be a top-level page.`)})}var Vq=Ti.omit({skillSelection:!0,visualTheme:!0,userChoices:!0,confirmedChoices:!0,seoKeywords:!0}).extend({meta:Ti.shape.meta.omit({source:!0}),site_name:t.string().min(1).max(80),pages:t.array(RT).min(1),navigation:IT}),DT=t.enum(["ai","user"]),Tn=t.object({site_id:k,page_id:We,edited_by:DT.default("ai"),source_agent_run_id:V.optional()}),Yq=Tn.extend({block_id:We,target_index:t.number().int().min(0)}),OT=Tn.extend({block_id:We}),NT=Tn.extend({block_id:We,instruction:t.string()}),Xq=Tn.extend({block_id:We,variant:t.string().min(1).nullable()}),Qq=Tn.extend({block_id:We,props:t.record(t.string(),t.unknown()),mode:t.enum(["replace","merge"]).default("replace")}),Zq=Tn.extend({block:t.object({id:We,label:t.string().trim().min(1),type:t.string().min(1),variant:t.string().min(1).optional(),props:t.record(t.string(),t.unknown()).default({}),insert_index:t.number().int().min(0).optional()})}),jT=t.enum(["move_block","delete_block","update_block_instruction","change_block_variant","update_block_props","add_block"]),Jq=t.discriminatedUnion("operation",[t.object({operation:t.literal("delete_block"),input:OT}).strict(),t.object({operation:t.literal("update_block_instruction"),input:NT}).strict()]),LT=t.enum(["SITEMAP_EDIT_INVALID","SITEMAP_API_NOT_CONFIGURED","SITEMAP_NOT_FOUND","SITEMAP_PAGE_NOT_FOUND","SITEMAP_BLOCK_NOT_FOUND","SITEMAP_BLOCK_ALREADY_EXISTS","SITEMAP_LAST_BLOCK_DELETE_FORBIDDEN","SITEMAP_EDIT_FAILED"]),MT=t.object({status:t.literal("updated"),operation:jT,site_id:k,sitemap_id:we,version:t.number().int().positive(),changed_pages:t.array(We).min(1),requires_code_patch:t.literal(!0)}),UT=t.object({status:t.literal("failed"),code:LT,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),e2=t.discriminatedUnion("status",[MT,UT]),Yo=t.object({question_id:t.string().min(1),value:t.string().min(1),label:t.string().min(1).optional(),question:t.string().min(1).optional(),option_label:t.string().min(1).optional(),motion_level:Go.optional(),visual_tonality:Fo.optional(),conversion:Gt.optional(),positioning:t.object({market:t.string().min(1).max(200),customer:t.string().min(1).max(200),purpose:t.string().min(1).max(60)}).optional()}),FT=t.object({id:t.string().trim().min(1).max(128),type:t.literal(1),search_intent:t.string().trim().min(1).max(255),path:t.string().trim().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),channel:t.string().trim().min(1).max(80),content_format:t.string().trim().min(1).max(80),priority:t.enum(["P0","P1","P2","P3"])}).strict(),t2=t.object({source:t.object({kind:t.literal("step5_strategy")}).strict()}).strict(),GT=t.object({item_key:vs,title:t.string().trim().min(1).max(200),selected_option_id:Mn,selected_label:t.string().trim().min(1).max(200),selected_value:t.string().trim().min(1).max(500),selected_description:t.string().trim().min(1).max(2e3),impact:t.string().trim().min(1).max(500).optional(),customer_note:t.string().trim().min(1).max(200).optional(),market_type:Ds.optional(),markets:t.array(Os).max(32).optional(),promoted_businesses:Ns.optional(),sections:t.array(t.object({id:t.string().min(1),label:t.string().min(1)}).strict()).optional()}).strict().superRefine((e,n)=>{e.item_key==="product"&&!e.promoted_businesses&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"The product sitemap decision requires ordered promoted businesses."}),e.item_key!=="product"&&e.promoted_businesses!==void 0&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"Promoted businesses are only valid for the product sitemap decision."})}),qT=t.object({kind:t.literal("step5_strategy"),site_name:t.string().trim().min(1).max(80).optional(),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/),decisions:t.array(GT).min(Ps).max(je),enterprise_keywords:t.array(jn).min(1).optional()}).strict().superRefine((e,n)=>{let s=e.decisions.map(a=>a.item_key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 sitemap decisions must use unique strategy keys."}),Ln.forEach(a=>{s.includes(a)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 sitemap decisions are missing ${a}.`})});let i=nn.filter(a=>s.includes(a));e.decisions.forEach((a,o)=>{a.item_key!==i[o]&&n.addIssue({code:"custom",path:["decisions",o,"item_key"],message:"Step5 sitemap decisions must use the canonical order."})})}),rd=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Zt,brief:t.string().min(20).max(1e3),answers:t.array(Yo).min(1).max(10),skillSelection:Rn,site_default_locale:Te.optional(),owner_locale:Te.optional(),cms_site_id:t.string().min(1).nullish(),intent_pages:t.array(FT).max(9).optional(),reference:ys.optional(),input_context:t.object({facts:t.array(bs).max(120),conflicts:t.array(xs).max(20)}).optional(),business_facts:yr.optional(),migration_products_enabled:t.boolean().optional()}),WT=rd.pick({tenant_id:!0,site_id:!0,skillSelection:!0,site_default_locale:!0,owner_locale:!0,cms_site_id:!0,reference:!0,input_context:!0,business_facts:!0,migration_products_enabled:!0}).partial({skillSelection:!0}).extend({source:qT}).strict(),n2=t.union([rd,WT]),cd=t.enum(["planning","generating","validating","ready"]),BT=t.enum(["salvaged","deterministic_fallback"]),KT=t.enum(["model_exception_settled_prefix","model_exception_safe_root"]),md={outcome:BT.optional(),reason:KT.optional(),attempts:t.number().int().positive().optional()};function ld(e,n){if(e.type!=="sitemap.generated")return;let s=e.outcome!==void 0,i=e.reason!==void 0;s!==i&&n.addIssue({code:"custom",path:[s?"reason":"outcome"],message:"sitemap.generated outcome and reason must be provided together"})}var zT=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:cd,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:we,sitemap:In,...md,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:I.optional(),at:t.string().min(1)})]),s2=zT.superRefine(ld),pd=t.object({id:we,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),source_agent_run_id:V.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}).strict();function dd(e,n){e.version!==e.sitemap.version&&n.addIssue({code:"custom",path:["sitemap","version"],message:`Sitemap JSON version ${e.sitemap.version} must equal record version ${e.version}.`})}var ud=pd.extend({sitemap:In}).superRefine(dd),_d=pd.extend({sitemap:bn}).superRefine(dd),i2=t.object({sitemap_id:we,creation_key:t.string().min(1),sitemap:bn,expected_current_sitemap_id:we,expected_current_sitemap_version:t.number().int().positive()}).strict().superRefine((e,n)=>{e.sitemap.version!==e.expected_current_sitemap_version&&n.addIssue({code:"custom",path:["sitemap","version"],message:"Draft version must match the expected base version."})}),a2=t.object({sitemap:_d}).strict();function o2(e){return`sitemap-user-draft:${e.site_id}:${e.expected_current_sitemap_id}:${e.expected_current_sitemap_version}:${e.sitemap_id}`}var r2=t.object({sitemap_id:we,creation_key:t.string().min(1),sitemap:In,source_agent_run_id:V.optional()}),c2=t.object({sitemap_id:we,creation_key:t.string().min(1),sitemap:bn,expected_current_sitemap_id:we,expected_current_sitemap_version:t.number().int().positive(),migration_content_requested:t.boolean().optional()}),m2=t.object({sitemap_id:we,creation_key:t.string().min(1),sitemap:In,source_agent_run_id:V}),l2=t.object({site:Ut,sitemap:ud,next_step:t.literal("workspace")}).strict(),p2=t.object({site:Ut,sitemap:_d,next_step:t.literal("workspace")}).strict(),d2=t.object({site:Ut,sitemap:ud,next_step:t.literal("sitemap_review")}).strict(),HT=t.object({id:nr,tenant_id:t.string().min(1),site_id:k,brief_id:Zt,questions:qo,answers:t.array(Yo),selected_archetype:Rn.optional(),completed_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),u2=t.object({answers:t.array(Yo).min(1),questions:qo,selected_archetype:Rn.optional()}),_2=t.object({clarify_session:HT}),g2=t.object({questions:qo,selected_archetype:Rn}),$T=t.object({id:Ci,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),design_plan:id,source_agent_run_id:V.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),h2=t.object({design_plan_id:Ci.optional(),design_plan:id,source_agent_run_id:V.optional()}),S2=t.object({design_plan:$T}),Pi=t.enum(["initial_generation","iteration","landing_page","fill_in"]),VT=t.object({label:t.string().min(1).max(48),prompt:t.string().min(1).max(160)}).strict(),YT=t.enum(["model","derived","mixed","advisor"]),gd=t.object({suggestions:t.array(VT).min(1).max(4),source:YT}).strict(),XT=t.enum(["clean","salvaged","deterministic_fallback","baseline_retained"]),QT=t.enum(["generation_succeeded","entry_slots_omitted","quality_gate_exhausted","schema_gate_exhausted","generation_timeout","stream_schema_mismatch","stream_generation_error","generation_error","fallback_compiler_error","legacy_result_missing_metadata"]),ZT=t.enum(["progress","assistant_final"]),hd=t.enum(["run.started","message.delta","user.message","plan.updated","clarify.partial","clarify.archetype_proposals","clarify.finished","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","sitemap.updated","sitemap.resync.failed","sitemap.resync.warning","block.changed","tool.started","tool.finished","workspace.plan.created","workspace.worker.updated","workspace.task.updated","workspace.degraded","workspace.design_plan.outcome","workspace.suggestions","workspace.generation_ledger","file.changed","snapshot.created","snapshot.finalized","preview.preparing","preview.ready","preview.build.started","preview.build.succeeded","preview.build.failed","run.failed","run.finished","media_resolution.started","media_resolution.finished","skill.selecting","skill.selected","activity.started","activity.updated","activity.finished","activity.failed"]),JT=t.object({id:t.string().min(1),title:t.string().min(1),status:t.enum(["pending","running","completed","failed"])}),Qt=t.enum(["pending","running","completed","completed_with_skips","failed","skipped"]),Xo=t.enum(["style_media","chrome","sections","layout","pages","detect_typecheck","repair","finalize","sitemap_resync","preview"]),Qo=t.object({code:t.string().min(1),message:t.string().min(1),path:t.string().min(1).optional(),task_id:t.string().min(1).optional(),details:t.record(t.string(),t.unknown()).optional()}),Oe=t.string().min(1).refine(e=>Pd(e),{message:"Snapshot file paths must be safe relative POSIX paths without traversal."}),Zo=t.object({deduped_paths:t.array(Oe),skipped_tasks:t.array(t.string().min(1)),failed_tasks:t.array(t.string().min(1)),fallback_files:t.array(t.string().min(1)),applied_paths:t.array(Oe)}),Jo=t.object({group_id:t.string().min(1),phase:Xo,title:t.string().min(1),status:Qt,task_ids:t.array(t.string().min(1)),depends_on_groups:t.array(t.string().min(1)),target_paths:t.array(Oe)}),ek=t.enum(["style","media","chrome","section","layout","page","breadcrumb"]),er=t.object({task_id:t.string().min(1),group_id:t.string().min(1),kind:ek,target_path:Oe,block_id:t.string().min(1).optional(),block_type:t.string().min(1).optional(),block_variant:t.string().min(1).optional(),block_order:t.number().int().nonnegative().optional(),user_instruction:t.string().min(1).optional(),page_id:t.string().min(1).optional(),page_slug:t.string().min(1).optional(),page_title:t.string().min(1).optional(),title:t.string().min(1).max(60).optional(),description:t.string().min(1).max(zo).optional(),status:Qt,required_reads:t.array(Oe).optional(),search_params_sections:t.array(Oe).optional(),standard_form_view:Oe.optional(),breadcrumb:t.object({trail:t.array(t.object({name:t.string().min(1),href:t.string().min(1).nullable(),omitted_href:t.string().min(1).optional()}).strict()).min(1),current:t.string().min(1),placement:sd.optional()}).strict().optional()}),tr=t.object({from_group_id:t.string().min(1),to_group_id:t.string().min(1),reason:t.enum(["style_media","chrome","sections","layout","page_composition","quality_gate"])}),f2=t.object({plan_id:t.string().min(1),run_kind:Pi,model_route:t.object({planner:t.literal("workspace_planner"),worker:t.literal("workspace")}),groups:t.array(Jo),tasks:t.array(er),dependencies:t.array(tr),expected_outputs:t.array(Oe),diagnostics:Zo}),b2=t.object({task_id:t.string().min(1),patch:t.unknown().optional(),snapshot_id:I.optional(),read_files:t.array(Oe),diagnostics:t.array(Qo),status:Qt}),Sd=t.object({worker_count:t.number().int().nonnegative(),task_count:t.number().int().nonnegative(),group_count:t.number().int().nonnegative()}),fd=t.object({pending:t.number().int().nonnegative(),running:t.number().int().nonnegative(),completed:t.number().int().nonnegative(),completed_with_skips:t.number().int().nonnegative(),failed:t.number().int().nonnegative(),skipped:t.number().int().nonnegative()}),tk=t.object({type:t.literal("text"),text:t.string(),state:t.enum(["streaming","done"]).optional()}),nk=t.object({type:t.literal("reasoning"),text:t.string(),state:t.enum(["streaming","done"]).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),sk=t.object({type:t.literal("file"),mediaType:t.string().min(1),filename:t.string().min(1).optional(),url:t.string().min(1)}),ik=t.object({type:t.literal("source-url"),sourceId:t.string().min(1),url:t.string().min(1),title:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),ak=t.object({type:t.literal("source-document"),sourceId:t.string().min(1),mediaType:t.string().min(1),title:t.string().min(1),filename:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),ok=t.object({type:t.string().regex(/^data-[a-zA-Z0-9_-]+$/),id:t.string().min(1).optional(),data:t.unknown()}),rk=t.object({type:t.string().regex(/^tool-[a-zA-Z0-9_-]+$/),toolCallId:t.string().min(1),state:t.enum(["input-streaming","input-available","output-available","output-error"]),input:t.unknown().optional(),output:t.unknown().optional(),errorText:t.string().min(1).optional()}),ck=t.object({type:t.literal("error"),errorText:t.string().min(1)}),mk=t.object({type:t.literal("step-start")}),ki=t.union([tk,nk,sk,ik,ak,ok,rk,ck,mk]),lk=t.string().min(1).max(512).refine(e=>Pd(e)&&!/^[A-Za-z]:\//.test(e),{message:"Generated-code rescue paths must be safe relative POSIX paths without traversal."}),pk=t.array(lk).min(1).max(64),dk=t.array(t.string().min(1).max(120)).min(1).max(64),bd=t.discriminatedUnion("outcome",[t.object({outcome:t.literal("full_success"),page_copy:Us.optional(),navigation:t.discriminatedUnion("status",[t.object({status:t.literal("not_requested")}).strict(),t.object({status:t.literal("succeeded")}).strict()])}).strict(),t.object({outcome:t.literal("partial_success"),page_copy:Us.optional(),navigation:t.object({status:t.literal("failed"),error_code:t.string().min(1).max(120),message:t.string().min(1).max(360)}).strict()}).strict()]).describe("Typed completion details for a committed Workspace Resource Run."),uk=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("message.delta"),text:t.string().min(1),history_purpose:ZT.optional(),at:t.string().min(1)}),t.object({type:t.literal("user.message"),client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(ki).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Gs.optional(),at:t.string().min(1)}),t.object({type:t.literal("plan.updated"),steps:t.array(JT),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Kp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:cd,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:we,sitemap:In,...md,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("sitemap.updated"),sitemap_id:we,version:t.number().int().positive(),reason:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.failed"),error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.warning"),code:t.string().min(1),message:t.string().min(1),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("block.changed"),block_id:t.string().min(1),change_type:t.enum(["add","update","delete","move"]),at:t.string().min(1)}),t.object({type:t.literal("tool.started"),tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("tool.finished"),tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:ba.optional(),interaction_failure:fa.optional(),at:t.string().min(1)}),t.object({type:t.literal("workspace.plan.created"),plan_id:t.string().min(1),run_kind:Pi,groups:t.array(Jo),tasks:t.array(er),dependencies:t.array(tr),expected_outputs:t.array(Oe),diagnostics:Zo,summary:Sd,at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.worker.updated"),group_id:t.string().min(1),phase:Xo,status:Qt,task_counts:fd,target_paths:t.array(Oe),diagnostics:t.array(t.string().min(1)),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.task.updated"),task_id:t.string().min(1),group_id:t.string().min(1),status:Qt,target_path:Oe,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(Qo).optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.degraded"),reason:t.enum(["block_placeholder","form_placeholder","patch_protected_dropped","preview_health_degraded","preview_build_failed","design_plan_fallback","generated_code_rescue","cms_page_directory_degraded","form_prebuild_skipped","form_section_fallback","first_settings_sync_failed","component_omitted","page_omitted","shared_fallback"]),degraded_block_ids:t.array(t.string().min(1)).min(1).optional(),dropped_files:t.array(t.string().min(1)).min(1).optional(),degraded_file_paths:pk.optional(),degraded_page_ids:dk.optional(),snapshot_id:I.optional(),code:t.string().min(1).optional(),message:t.string().min(1).optional(),diagnostics:t.string().min(1).optional(),retryable:t.boolean().optional(),at:t.string().min(1)}).strict().superRefine((e,n)=>{let s=e.reason==="generated_code_rescue",i=e.reason==="page_omitted",a=e.reason==="shared_fallback";if(!s){if(e.degraded_file_paths!==void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"degraded_file_paths is only allowed for generated_code_rescue"}),e.degraded_page_ids!==void 0&&!i&&n.addIssue({code:"custom",path:["degraded_page_ids"],message:"degraded_page_ids is only allowed for generated_code_rescue or page_omitted"}),a)for(let o of["degraded_block_ids","dropped_files","snapshot_id","code","diagnostics","retryable"])e[o]!==void 0&&n.addIssue({code:"custom",path:[o],message:`${o} is not allowed for shared_fallback`});return}e.degraded_file_paths===void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"generated_code_rescue requires degraded_file_paths"});for(let o of["degraded_block_ids","dropped_files","snapshot_id","code","message","diagnostics","retryable"])e[o]!==void 0&&n.addIssue({code:"custom",path:[o],message:`${o} is not allowed for generated_code_rescue`})}),t.object({type:t.literal("workspace.design_plan.outcome"),design_plan_outcome:XT,reason:QT,gate_diagnostics:t.object({gate:t.enum(["quality","schema"]),issue_codes:t.array(t.string().min(1)).max(20),issue_paths:t.array(t.string()).max(20),finish_reason:t.string().min(1).optional()}).strict().optional(),media_floor:t.object({total_blocks:t.number().int().min(0),media_bearing_blocks:t.number().int().min(0),hero_total:t.number().int().min(0),hero_media_bearing:t.number().int().min(0),pages_without_media:t.array(t.string().min(1)).max(50),met:t.boolean()}).strict().optional(),at:t.string().min(1)}).strict(),gd.extend({type:t.literal("workspace.suggestions"),at:t.string().min(1)}).strict(),Rr,t.object({type:t.literal("file.changed"),path:t.string().min(1),change_type:t.enum(["create","update","delete"]),diff:t.string().optional(),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("snapshot.finalized"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.preparing"),at:t.string().min(1)}),t.object({type:t.literal("preview.ready"),url:t.string().url(),at:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({type:t.literal("preview.build.started"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.build.succeeded"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.build.failed"),snapshot_id:I,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:zp.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:I.optional(),degraded_reason:Pn.optional(),build_verified:t.boolean().optional(),generation_ledger:On.optional(),resource_operation:bd.optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().datetime()}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().datetime()}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("activity.started"),activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:Jp,title:t.string().min(1).max(200),detail:t.string().max(360).optional(),title_code:Mt.optional(),detail_code:Mt.optional(),locks_input:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("activity.updated"),activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),detail:t.string().max(360).optional(),title_code:Mt.optional(),detail_code:Mt.optional(),at:t.string().min(1)}),t.object({type:t.literal("activity.finished"),activity_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("activity.failed"),activity_id:t.string().min(1),detail:t.string().max(360).optional(),at:t.string().min(1)})]),yd=uk.superRefine(ld).superRefine((e,n)=>{if(e.type==="user.message"&&e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type==="run.finished"&&e.resource_operation&&!e.snapshot_id&&n.addIssue({code:"custom",path:["snapshot_id"],message:"resource_operation requires a confirmed snapshot_id"}),e.type!=="tool.finished")return;let s=e.name==="prepare_product_search_entry",i=!!e.interaction_request,a=!!e.interaction_failure;(s?i!==a:!i&&!a)||n.addIssue({code:"custom",path:["interaction_request"],message:s?"prepare_product_search_entry requires exactly one of interaction_request or interaction_failure":"product search interaction results are only valid for prepare_product_search_entry"})}),Uo=t.object({id:ir,tenant_id:t.string().min(1),site_id:k,agent_run_id:V,sequence:t.number().int().positive(),event_type:hd,payload:yd,created_at:t.string().min(1),thread_id:at.nullable().optional()}),y2=t.object({event_type:hd,payload:yd}).superRefine((e,n)=>{e.event_type!==e.payload.type&&n.addIssue({code:"custom",path:["payload","type"],message:"payload.type must match event_type"}),us(e.payload)&&n.addIssue({code:"custom",path:["payload"],message:"AgentEvent payload must not contain secrets"})}),x2=t.discriminatedUnion("status",[t.object({status:t.literal("appended"),agent_run:it,event:Uo,next_cursor:t.number().int().nonnegative()}),t.object({status:t.literal("duplicate_ignored"),agent_run:it,event:Uo,next_cursor:t.number().int().nonnegative()})]),E2=t.object({events:t.array(Uo),next_cursor:t.number().int().nonnegative().optional()}),R2=t.object({after_sequence:t.coerce.number().int().nonnegative().default(0)}),I2=t.object({run_id:V.optional(),thread_id:at.optional()}).superRefine((e,n)=>{e.run_id&&e.thread_id&&n.addIssue({code:"custom",path:["thread_id"],message:"run_id and thread_id are mutually exclusive"})}),T2=t.enum(["implemented","skeleton","planned"]),k2=t.enum(["GET","POST","PUT","PATCH","DELETE"]),A2=[{method:"PATCH",path:"/internal/sites/:site_id/snapshots/:snapshot_id/manifest",tag:"snapshots",summary:"Compare-and-set the manifest hash for the active current snapshot after an in-place object replacement.",status:"implemented",request_body_schema:"UpdateCurrentSnapshotManifestRequestSchema",response_schema:"SnapshotRecordSchema",notes:["Internal Agent authentication is required. The update succeeds only when site current_snapshot_id, snapshot status, object key, and expected manifest hash still match."]},{method:"GET",path:"/health",tag:"system",summary:"API health check.",status:"implemented",response_schema:"ApiHealth"},{method:"POST",path:"/sites",tag:"sites",summary:"Create a site and Step 1 brief in the current dev context.",status:"implemented",request_body_schema:"CreateSiteBriefRequestSchema",response_schema:"CreateSiteBriefResponseSchema"},{method:"POST",path:"/sites/drafts",tag:"sites",summary:"Create a draft site without a brief in the current tenant so /s/:site_id can collect Step 1 later.",status:"implemented",request_body_schema:"CreateSiteDraftRequestSchema",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites",tag:"sites",summary:"List current tenant sites.",status:"implemented",response_schema:"SiteRecordSchema[]"},{method:"GET",path:"/sites/by-cms/:cms_site_id",tag:"sites",summary:"Resolve an external CMS site id to one tenant-scoped VCP site.",status:"implemented",response_schema:"SiteRecordSchema",notes:["Used by the browser /d/:cms_site_id handoff route; lookup is scoped by current request tenant and returns 404 when the CMS site has not been synchronized."]},{method:"GET",path:"/sites/:site_id",tag:"sites",summary:"Get one tenant-scoped site.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"POST",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Create one version-bound site workflow from a published flow definition.",status:"implemented",request_body_schema:"CreateSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Read the current site workflow snapshot and derived menu state.",status:"implemented",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/workflow/progress",tag:"site-workflows",summary:"Read the minimal internal site workflow progress projection.",status:"implemented",response_schema:"SiteWorkflowProgressResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/website",tag:"site-workflows",summary:"Update the source website while website_scan is current.",status:"implemented",request_body_schema:"UpdateSiteWorkflowWebsiteRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/advance",tag:"site-workflows",summary:"Advance one non-terminal workflow node with an expected-current-node guard.",status:"implemented",request_body_schema:"AdvanceSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/complete",tag:"site-workflows",summary:"Complete the workflow from its final publishing node after server-side release checks pass.",status:"implemented",request_body_schema:"CompleteSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The browser supplies only the expected current node; the server verifies persisted release facts before completing the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/complete-quality-only",tag:"site-workflows",summary:"Complete the designer workflow after the linked quality-only publish workflow succeeds.",status:"implemented",request_body_schema:"CompleteQualityOnlyWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The server resolves the designer role and atomically completes both workflows without creating a publish deployment or updating the site deployment projection."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/register",tag:"site-workflows",summary:"Register a business-owned external task id and its idempotency key.",status:"implemented",request_body_schema:"RegisterWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/step2-site-initialization/tasks",tag:"site-workflows/step2-site-initialization",summary:"Create or reuse the current workflow's Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The server derives tenantId, sessionId, and siteUrl from trusted request/workflow state; the browser cannot submit upstream scope fields."]},{method:"GET",path:"/sites/:site_id/workflow/step2-site-initialization/tasks/:task_id",tag:"site-workflows/step2-site-initialization",summary:"Poll the workflow-owned Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The task id must match the current non-superseded website_crawl task reference for the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/:task_type/replace",tag:"site-workflows",summary:"Replace one task reference while retaining its superseded history.",status:"implemented",request_body_schema:"ReplaceWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/tasks/website_crawl/replace-and-invalidate-dependents",tag:"site-workflows",summary:"Replace website crawl and invalidate basic-info and metrics dependents atomically.",status:"implemented",request_body_schema:"ReplaceCrawlWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/build",tag:"site-workflows",summary:"Start the server-owned site build and workspace snapshot lifecycle.",status:"implemented",request_body_schema:"StartSiteBuildRequestSchema",response_schema:"StartSiteBuildResponseSchema",notes:["The browser may start or query the build, but cannot write site build or deployment summary status directly."]},{method:"GET",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Read the persisted no-website customer materials draft.",status:"implemented",response_schema:"CustomerMaterialsNullableResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Save the no-website customer materials before submission.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["A submitted record is immutable and rejects later writes."]},{method:"POST",path:"/sites/:site_id/workflow/customer-materials/submit",tag:"site-workflows",summary:"Submit and freeze customer materials before analysis.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["Repeated submissions return 409; clients may retry only the separate workflow advance."]},{method:"GET",path:"/sites/:site_id/designer/component-library/categories",tag:"designer-component-library",summary:"List the fixed insert-new-component category tree for a site.",status:"implemented",response_schema:"ListDesignerComponentCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewComponent."]},{method:"GET",path:"/sites/:site_id/designer/component-library/resources",tag:"designer-component-library",summary:"List component resources from the fixed designer catalog group.",status:"implemented",query_schema:"ListDesignerComponentsQuerySchema",response_schema:"ListDesignerComponentsResponseSchema",notes:["The server fixes resource type to component and does not expose resource-platform secrets, internal hosts, or product-line selection."]},{method:"POST",path:"/sites/:site_id/designer/component-library/resources/:resource_id/install",tag:"designer-component-library",summary:"Install one exact component version and return a strict SiteEditEngine materialization.",status:"implemented",request_body_schema:"InstallDesignerComponentBodySchema",response_schema:"InstallDesignerComponentResponseSchema",notes:["The server downloads the resource ZIP with the configured secret, validates main.json identity and compatibility, and returns only the strict materialization plus immutable revision metadata."]},{method:"GET",path:"/sites/:site_id/designer/page-library/categories",tag:"designer-page-library",summary:"List the fixed insert-new-page category tree for a site.",status:"implemented",response_schema:"ListDesignerPageCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewPage."]},{method:"GET",path:"/sites/:site_id/designer/page-library/resources",tag:"designer-page-library",summary:"List page and pages resources from the fixed designer catalog.",status:"implemented",query_schema:"ListDesignerPagesQuerySchema",response_schema:"ListDesignerPagesResponseSchema",notes:["The server fixes resource types to page and pages and does not expose resource-platform credentials or internal routing."]},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/prepare",tag:"designer-page-library",summary:"Resolve one exact page resource version for designer-side draft configuration.",status:"implemented",request_body_schema:"PrepareDesignerPageBodySchema",response_schema:"PrepareDesignerPageResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/install",tag:"designer-page-library",summary:"Install one exact page resource version and return a strict PageResourceArtifact.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server validates the explicit resource type, immutable package identity, page selections, materializations, and package-local references."]},{method:"GET",path:"/sites/:site_id/designer/pages",tag:"designer-page-library",summary:"List designer pages from the stable first-phase fixture source.",status:"implemented",response_schema:"ListDesignerSitePagesResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/enhance",tag:"designer-page-library",summary:"Echo a designer page-resource candidate without model execution or normalization.",status:"implemented",request_body_schema:"EnhanceDesignerPageResourceBodySchema",response_schema:"EnhanceDesignerPageResourceResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/compose",tag:"designer-page-library",summary:"Compose exact page and component resources into one strict page artifact.",status:"implemented",request_body_schema:"ComposeDesignerPageResourceBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server installs every immutable source, validates ordered page blocks, scopes component materializations, and returns one artifact without exposing resource-platform credentials."]},{method:"POST",path:"/sites/:site_id/designer/page-resources/blank",tag:"designer-page-library",summary:"Create the deterministic built-in blank page artifact for one configured route.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema"},{method:"PATCH",path:"/sites/:site_id",tag:"sites",summary:"Update site display name and optional generated-site locale for the current tenant.",status:"implemented",request_body_schema:"UpdateSiteRequestSchema",response_schema:"SiteRecordSchema"},{method:"DELETE",path:"/sites/:site_id",tag:"sites",summary:"Archive a site so it no longer appears in the tenant site list.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites/:site_id/workspace/source-files",tag:"sites",summary:"List source files available in the ready preview sandbox.",status:"implemented",response_schema:"WorkspaceSourceFileListItemSchema[]"},{method:"GET",path:"/sites/:site_id/workspace/source-file",tag:"sites",summary:"Read a source file from the ready preview sandbox.",status:"implemented",query_schema:"WorkspaceSourceFilePathQuerySchema",response_schema:"WorkspaceSourceFileResponseSchema"},{method:"GET",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"List or search enterprise image assets through the CMS adapter.",status:"implemented",query_schema:"ListMediaLibraryAssetsQuerySchema",response_schema:"ListMediaLibraryAssetsResponseSchema"},{method:"POST",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"Upload one validated image and create its enterprise asset.",status:"implemented",response_schema:"UploadMediaLibraryAssetResponseSchema",notes:["Accepts one multipart field named file; only the image MIME allowlist is accepted and the maximum size is 20 MiB."]},{method:"GET",path:"/sites/:site_id/media-assets/unsplash/search",tag:"media-assets",summary:"Search Unsplash through the VCP server-side client.",status:"implemented",query_schema:"SearchUnsplashMediaQuerySchema",response_schema:"SearchUnsplashMediaResponseSchema",notes:["The browser never receives the Unsplash access key; CMS is not involved in search."]},{method:"POST",path:"/sites/:site_id/media-assets/unsplash/:provider_id/use",tag:"media-assets",summary:"Best-effort report that an Unsplash image was selected.",status:"implemented",request_body_schema:"UseUnsplashMediaRequestSchema",response_schema:"UseUnsplashMediaResponseSchema",notes:["CMS report failure returns reported=false and does not roll back the image replacement."]},{method:"POST",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Confirm the currently reviewed Sitemap Draft and advance the site to structure_saved.",status:"implemented",request_body_schema:"ConfirmSiteStructureRequestSchema",response_schema:"PersistSiteSitemapDraftResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/sitemap-draft",tag:"sitemaps",summary:"Persist an agent-generated sitemap draft without confirming the structure.",status:"implemented",request_body_schema:"PersistGeneratedSitemapDraftRequestSchema",response_schema:"PersistGeneratedSitemapDraftResponseSchema"},{method:"PUT",path:"/sites/:site_id/sitemap/draft",tag:"sitemaps",summary:"Save an immutable user draft without confirming or advancing the workflow.",status:"implemented",request_body_schema:"SaveSiteSitemapDraftRequestSchema",response_schema:"SaveSiteSitemapDraftResponseSchema"},{method:"GET",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Read the current Sitemap Draft for a site.",status:"implemented",response_schema:"SitemapDraftRecordSchema"},{method:"POST",path:"/sites/:site_id/clarify/answers",tag:"clarify",summary:"Persist the Step 2 clarify answers (and the answered questions) into the site's clarify session.",status:"implemented",request_body_schema:"PersistClarifyAnswersRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema"},{method:"PATCH",path:"/sites/:site_id/clarify/archetype",tag:"clarify",summary:"Switch the Step 2 industry archetype (user_picked) into the site's clarify session via an idempotent upsert.",status:"implemented",request_body_schema:"UpdateClarifyArchetypeRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema",notes:["Independent of generate: materializes a clarify_sessions row when none exists (using the supplied questions) or updates only selected_archetype; never writes answers/completed_at. Forces source=user_picked."]},{method:"POST",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Persist a generated design plan version for a site (internal agent-only write).",status:"implemented",request_body_schema:"PersistSiteDesignPlanRequestSchema",response_schema:"PersistSiteDesignPlanResponseSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent writes design plans."]},{method:"GET",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site (internal agent-only read).",status:"implemented",response_schema:"DesignPlanRecordSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent reads design plans."]},{method:"GET",path:"/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site so Workspace UI can inspect the generated design contract.",status:"implemented",response_schema:"DesignPlanRecordSchema"},{method:"GET",path:"/sites/:site_id/brief",tag:"briefs",summary:"Read the persisted Step 1 brief for a site so the Workspace Agent can seed first full-site generation without a new write surface.",status:"implemented",response_schema:"BriefRecordSchema"},{method:"PUT",path:"/sites/:site_id/brief/draft",tag:"briefs",summary:"Save a draft site's Step 1 brief without advancing the workflow.",status:"implemented",request_body_schema:"SaveBriefDraftRequestSchema",response_schema:"SaveBriefDraftResponseSchema",notes:["Only sites in the editable build phase are writable; the brief row is upserted idempotently while site status, locale, and workflow stage remain unchanged."]},{method:"PATCH",path:"/sites/:site_id/brief",tag:"briefs",summary:"Create or update a draft site's Step 1 brief and advance it to Clarify without allowing later workflow states to roll back.",status:"implemented",request_body_schema:"UpdateBriefRequestSchema",response_schema:"UpdateBriefResponseSchema",notes:["Only sites in the editable build phase are writable; missing brief rows are created on first save; identical retries are idempotent."]},{method:"POST",path:"/internal/sites/:cms_site_id/external-sync",tag:"sites",summary:"Synchronize trusted CMS identity by tenant_id + cms_site_id; legacy site_url is optional and ignored. The response URL is the configured public API base or null.",status:"implemented",request_body_schema:"ExternalSyncSiteRequestSchema",response_schema:"ExternalSyncSiteResponseSchema",notes:["This trusted external entry does not require browser login or internal bearer auth; tenant_id is written directly to tenants.id and the response uses the internal { code, data, message } success envelope."]},{method:"POST",path:"/internal/sites/:site_id/page-templates",tag:"page-templates",summary:"Accept 1\u20133 Page Template items as one asynchronous Workspace task (HTTP 202).",status:"implemented",request_body_schema:"PageTemplateCreateRequestSchema",response_schema:"PageTemplateCreateResponseSchema",notes:["Internal bearer plus tenant context; API starts one new background thread/run with its fixed system identity. Poll GET /internal/external-site-edits/:task_id; no external IDs or callbacks. Manifest-gated whole-batch success commits exactly one snapshot."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/promote",tag:"page-templates",summary:"Promote a private page template through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplatePromoteRequestSchema",response_schema:"PageTemplatePromoteResponseSchema",notes:["Internal service endpoint; uses the same bearer + tenant/user context as create and delegates to Agent with API-owned credentials."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/cleanup",tag:"page-templates",summary:"Clean up private page templates through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplateCleanupRequestSchema",response_schema:"PageTemplateCleanupResponseSchema",notes:["Internal service endpoint; cleanup remains explicit and default-template protection is enforced by the Agent lifecycle service."]},{method:"POST",path:"/sites/:site_id/snapshots",tag:"snapshots",summary:"Persist snapshot metadata without changing the current site snapshot.",status:"implemented",request_body_schema:"PersistSiteSnapshotRequestSchema",response_schema:"PersistSiteSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"Promote a site snapshot as the current workspace version.",status:"implemented",request_body_schema:"PromoteSiteSnapshotRequestSchema",response_schema:"PromoteSiteSnapshotResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/try-acquire",tag:"snapshots",summary:"Try to acquire the short-lived template-upgrade site lock.",status:"implemented",request_body_schema:"TryAcquireTemplateUpgradeLockRequestSchema",response_schema:"TryAcquireTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; lock contention returns acquired=false instead of a user-facing conflict."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/release",tag:"snapshots",summary:"Release the calling template-upgrade attempt's site lock.",status:"implemented",request_body_schema:"ReleaseTemplateUpgradeLockRequestSchema",response_schema:"ReleaseTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; release is scoped by tenant, site, operation type, and owner."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"CAS-promote a validated template-upgrade candidate and bind its accepted commit atomically.",status:"implemented",request_body_schema:"PromoteTemplateUpgradeSnapshotRequestSchema",response_schema:"PromoteTemplateUpgradeSnapshotResponseSchema",notes:["Internal agent-only endpoint; accepted_commit is never part of the public promote request or response."]},{method:"GET",path:"/internal/sites/:site_id/template-upgrade/state",tag:"snapshots",summary:"Inspect the projected tenant-scoped template-upgrade state without mutation.",status:"implemented",query_schema:"InspectTemplateUpgradeStateRequestSchema",response_schema:"InspectTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the repository path is read-only."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/prepare",tag:"snapshots",summary:"Prepare the tenant-scoped template-upgrade retry state for a target version.",status:"implemented",request_body_schema:"PrepareTemplateUpgradeStateRequestSchema",response_schema:"PrepareTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/failure",tag:"snapshots",summary:"Record a finite validation failure for the prepared template-upgrade target.",status:"implemented",request_body_schema:"RecordTemplateUpgradeFailureRequestSchema",response_schema:"RecordTemplateUpgradeFailureResponseSchema",notes:["Internal agent-only endpoint; accepts a finite error code and never raw validation output."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/success",tag:"snapshots",summary:"Reset retry state after the prepared template-upgrade target succeeds.",status:"implemented",request_body_schema:"RecordTemplateUpgradeSuccessRequestSchema",response_schema:"RecordTemplateUpgradeSuccessResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/events",tag:"snapshots",summary:"Record one bounded template-upgrade observability event.",status:"implemented",request_body_schema:"RecordTemplateUpgradeEventRequestSchema",response_schema:"RecordTemplateUpgradeEventResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the strict request excludes raw errors, source content, and file paths."]},{method:"GET",path:"/internal/template-upgrades/report",tag:"snapshots",summary:"Read tenant-scoped template-upgrade outcome, state, and duration aggregates.",status:"implemented",query_schema:"GetTemplateUpgradeReportQuerySchema",response_schema:"GetTemplateUpgradeReportResponseSchema",notes:["Internal endpoint; tenant identity is derived from trusted request context and all aggregates are tenant-scoped."]},{method:"GET",path:"/internal/template-upgrades/snapshot-deletions/pending",tag:"snapshots",summary:"List tenant-scoped stale template-upgrade snapshot deletions for dry-run or reconciliation.",status:"implemented",query_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema",response_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema",notes:["Defaults to retrying deleting tombstones. Including candidate snapshots is an explicit maintenance action and should use a conservative age threshold."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/abandon",tag:"snapshots",summary:"Mark an unpromoted candidate snapshot as failed.",status:"implemented",response_schema:"AbandonSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Read one tenant-scoped snapshot metadata record for a site.",status:"implemented",response_schema:"SnapshotRecordSchema"},{method:"DELETE",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Prepare two-phase deletion of a candidate snapshot and return its object key; refuses non-candidate/current/referenced snapshots.",status:"implemented",response_schema:"DeleteSiteSnapshotResponseSchema",notes:["Internal Agent authentication is required. This endpoint only creates a deleting tombstone; object removal and completion are separate steps."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/deletion/complete",tag:"snapshots",summary:"Complete deletion after the snapshot object has been removed; only accepts deleting snapshots.",status:"implemented",response_schema:"CompleteSiteSnapshotDeletionResponseSchema",notes:["Internal Agent authentication is required; callers must remove the object before completing the DB deletion."]},{method:"POST",path:"/agent-runs",tag:"agent-runs",summary:"Create an agent run for event persistence and replay.",status:"implemented",request_body_schema:"CreateAgentRunRequestSchema",response_schema:"CreateAgentRunResponseSchema"},{method:"POST",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Append one normalized AgentEvent to a run.",status:"implemented",request_body_schema:"AppendAgentEventRequestSchema",response_schema:"AppendAgentEventResponseSchema",notes:["Internal-only write surface: only internal-service callers may append, except browser (oidc) contexts may append run.failed (the WS connect-stage unlock path, equivalent to POST /agent-runs/workspace/cancel). All other oidc appends \u2014 run.finished, run.started, tool/system/progress, file/snapshot \u2014 are rejected with 403 FORBIDDEN. The browser sends user messages over the Workspace WebSocket (recorded server-side as user.message) and otherwise only reads the GET replay."]},{method:"GET",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Replay AgentEvents after a run-local sequence cursor.",status:"implemented",response_schema:"ListAgentEventsResponseSchema"},{method:"POST",path:"/agent-runs/workspace/stop",tag:"agent-runs",summary:"Request a soft stop of the active first-generation or fill-in run for a site.",status:"implemented",request_body_schema:"StopWorkspaceGenerationRequestSchema",response_schema:"StopWorkspaceGenerationResponseSchema",notes:["Browser surface with the same tenant scoping as POST /agent-runs/workspace/cancel: only the active initial_generation / fill_in run of a site in the caller's tenant is touched.","A run holding a live lease gets stop_requested_at instead of a terminal event, so it keeps the pages it already saved and closes itself: status=requested, or already_requested on a repeat (the first stop timestamp is never moved).","A run whose lease has lapsed has no process left to honour the flag, so it is closed immediately (run.failed, site lock released) and the answer is status=stopped. Nothing in flight returns no_active_run with run_id null."]},{method:"POST",path:"/internal/agent-runs/fail-stale-in-flight",tag:"agent-runs",summary:"Fail stale in-flight workspace runs (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"FailStaleInFlightWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard (Bearer VCP_AGENT_INTERNAL_TOKEN, production fail-closed); the /internal/** prefix is exempt from browser auth middleware so the guard is the sole trust boundary. Not exposed to the browser via agent-proxy; called by an external admin cron / controlled ops script."]},{method:"POST",path:"/internal/agent-runs/claim-stale-workspace-runs",tag:"agent-runs",summary:"Claim stale workspace runs for resumption (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"ClaimStaleWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard; same trust boundary as fail-stale-in-flight and not exposed to the browser.","Re-issues a fresh lease_owner (fencing token) and increments resume_count in one UPDATE for each resumable initial run; a lease expiring only means the work was interrupted, not that the run failed. Initial runs that used up WORKSPACE_MAX_RESUME_COUNT and interrupted fill-in runs are failed instead and are absent from the response."]},{method:"GET",path:"/internal/agent-runs/:run_id/context",tag:"agent-runs",summary:"Resolve run thread context (internal, Agent Runtime).",status:"implemented",response_schema:"AgentRunContextResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Returns the run together with its thread (null = the site main thread); a run outside the tenant is 404."]},{method:"POST",path:"/internal/agent-runs/:run_id/heartbeat",tag:"agent-runs",summary:"Renew a workspace run lease (internal, Agent Runtime).",status:"implemented",request_body_schema:"WorkspaceRunHeartbeatRequestSchema",response_schema:"WorkspaceRunHeartbeatResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","One CAS UPDATE checks that the run is still in flight and that lease_owner has not been re-issued: superseded means another attempt took over and this process must stop dispatching; not_active means the run already reached a terminal state."]},{method:"POST",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"Register a workspace page checkpoint (internal, Agent Runtime).",status:"implemented",request_body_schema:"RegisterWorkspacePageCheckpointRequestSchema",response_schema:"WorkspacePageCheckpointSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Idempotent on (tenant_id, run_id, page_id, attempt): a conflict returns the existing row unchanged. The object must already be written to storage \u2014 a failed registration means the page was not saved. A lease_owner that no longer matches the run is 409, and a run in a terminal state is 409."]},{method:"GET",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"List workspace page checkpoints (internal, Agent Runtime).",status:"implemented",response_schema:"ListWorkspacePageCheckpointsResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; returns one row per page_id (the highest attempt). A run outside the tenant returns no checkpoints."]},{method:"GET",path:"/internal/agent-runs/:run_id/run-control",tag:"agent-runs",summary:"Read workspace run control input (internal, Agent Runtime).",status:"implemented",response_schema:"WorkspaceRunControlInputResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; AgentRunRecord carries no input, so the lease owner, stop flag, resume count and fill-in inputs stored on the run row are read here. A run outside the tenant, or one that is not a workspace run, is 404."]},{method:"GET",path:"/deployments",tag:"deployments",summary:"Deployment resource summary endpoint until publish APIs land.",status:"skeleton"},{method:"GET",path:"/sites/:site_id/generation-ledger",tag:"sites",summary:"Read the stored generation ledger of a site (omitted deliverables and fill-in progress).",status:"implemented",response_schema:"SiteGenerationLedgerResponseSchema",notes:["One ledger per (tenant_id, site_id), written when an initial_generation / fill_in run.finished carries generation_ledger. A site that has never finished such a run returns ledger null with source_run_id and updated_at null."]},{method:"POST",path:"/sites/:site_id/generation/fill-in",tag:"sites",summary:"Start a fill-in run for deliverables the generation ledger still lists as omitted.",status:"implemented",request_body_schema:"StartFillInRequestSchema",response_schema:"StartFillInResponseSchema",notes:["Every target must still be listed as an unfilled omission in the site ledger; otherwise 400 FILL_IN_TARGET_NOT_OMITTED with details.target_id. A site with no ledger at all is rejected with the same code.","The site must be workspace_ready; otherwise 409 FILL_IN_NOT_AVAILABLE.","A fill-in run does not take the per-site workspace_run operation lock: while it runs the user keeps browsing. client_run_key makes the POST idempotent \u2014 repeating it returns the existing in-flight run and does not dispatch it again; another in-flight workspace run on the same site is rejected with 409 WORKSPACE_RUN_IN_FLIGHT."]},{method:"POST",path:"/sites/:site_id/workspace/runs",tag:"workspace",summary:"Start an asynchronous Workspace Agent run from the current snapshot.",status:"implemented",request_body_schema:"StartWorkspaceRunRequestSchema",response_schema:"StartWorkspaceRunResponseSchema",notes:["Long-running work must be event-driven and must not block API transactions."]},{method:"POST",path:"/sites/:site_id/workspace/attachments",tag:"workspace",summary:"Upload a chat image attachment for the Workspace conversation.",status:"implemented",response_schema:"WorkspaceAttachmentSchema",notes:["multipart/form-data with a single `file`; the response `image_url` is referenced by a `file` part of the next client message."]},{method:"POST",path:"/sites/:site_id/workspace/attachments/from-url",tag:"workspace",summary:"Capture a screenshot of a web page and store it as a chat image attachment.",status:"implemented",request_body_schema:"WorkspaceAttachmentFromUrlRequestSchema",response_schema:"WorkspaceAttachmentSchema",notes:["The screenshot becomes an ordinary attachment: same quotas, same `file` part reference, never placed on the site.","Capture runs through the ingestion service (SSRF guard, concurrency gate, Firecrawl credits)."]},{method:"GET",path:"/sites/:site_id/workspace/attachments/:attachment_id/image",tag:"workspace",summary:"Read the bytes of a chat image attachment (owner thumbnails and replay).",status:"implemented"},{method:"DELETE",path:"/sites/:site_id/workspace/attachments/:attachment_id",tag:"workspace",summary:"Delete an unsent chat image attachment.",status:"implemented",notes:["Attachments already sent with a message return 409 WORKSPACE_ATTACHMENT_BOUND."]},{method:"GET",path:"/internal/workspace-attachments/:site_id/:attachment_id",tag:"workspace",summary:"Internal side-channel for the Workspace Agent to read a chat image attachment.",status:"implemented"},{method:"GET",path:"/sites/:site_id/threads",tag:"workspace",summary:"List a site's named Agent threads (workspace conversations).",status:"implemented",response_schema:"SiteThreadListResponseSchema",notes:["The browser can only list threads that belong to the current site."]},{method:"POST",path:"/sites/:site_id/threads",tag:"workspace",summary:"Create a new named Agent thread for a site.",status:"implemented",request_body_schema:"CreateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The created thread is scoped to the current site; the browser cannot create a thread for another site."]},{method:"PATCH",path:"/sites/:site_id/threads/:thread_id",tag:"workspace",summary:"Rename or archive an Agent thread.",status:"implemented",request_body_schema:"UpdateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The server verifies the thread belongs to the current site and tenant before applying the update."]},{method:"GET",path:"/sites/:site_id/workspace/runs/active",tag:"workspace",summary:"Look up the site's current in-flight Workspace Agent run across all threads.",status:"implemented",response_schema:"ActiveWorkspaceRunResponseSchema",notes:["Scoped to the current site regardless of thread; the browser cannot query another site's active run."]},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations",tag:"agent/workspace",summary:"Create or replay a deterministic FORM_SPEC save operation.",status:"implemented",request_body_schema:"FormDesignSaveRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id",tag:"agent/workspace",summary:"Read a persisted FORM_SPEC save operation.",status:"implemented",response_schema:"FormDesignOperationResponseSchema"},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id/resume",tag:"agent/workspace",summary:"Resume a recoverable FORM_SPEC save with its original fingerprint.",status:"implemented",request_body_schema:"FormDesignResumeRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/sites/:site_id/workspace/runs/latest",tag:"workspace",summary:"Look up the latest workspace Agent run for a site so Step 4 re-entry can replay persisted events without re-triggering the model.",status:"implemented",response_schema:"LatestWorkspaceRunResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sessions",tag:"sandbox-sessions",summary:"Persist or update an Agent-owned on-demand preview session; optional current/ready-session guards support current-snapshot CAS and guarded in-place snapshot advance.",status:"implemented",request_body_schema:"PersistPreviewSessionRequestSchema",response_schema:"PersistPreviewSessionResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sandbox-cleanups/claim",tag:"sandbox-sessions",summary:"Claim up to 32 persisted retired preview sessions under exact current snapshot and canonical ready-session CAS; preserve the current physical sandbox and retry stopping tombstones across processes.",status:"implemented",request_body_schema:"ClaimPreviewSandboxCleanupsRequestSchema",response_schema:"ClaimPreviewSandboxCleanupsResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sandbox-cleanups/:session_id/complete",tag:"sandbox-sessions",summary:"Acknowledge confirmed provider termination for an exact tenant/site/session/sandbox stopping tombstone; matching stopped acknowledgements are idempotent.",status:"implemented",request_body_schema:"CompletePreviewSandboxCleanupRequestSchema",response_schema:"CompletePreviewSandboxCleanupResponseSchema"},{method:"GET",path:"/sites/:site_id/preview-sessions/current",tag:"sandbox-sessions",summary:"Read the latest tenant-scoped preview session for a site.",status:"implemented",response_schema:"SandboxSessionSchema"},{method:"POST",path:"/sites/:site_id/preview/activate",tag:"site-preview",summary:"Activate the existing preview sandbox for a site.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/v1/agent/site-preview/:site_id/activate",tag:"agent/site-preview",summary:"Activate the existing preview sandbox for a site through Agent.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/sites/:site_id/deployments",tag:"deployments",summary:"Queue an explicit user-confirmed publish from the latest current snapshot.",status:"implemented",request_body_schema:"CreateDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema",notes:["The server resolves the latest current snapshot and validates site and snapshot existence, in-flight deployment state, and site operation lock before creating the deployment record and queue job.","The API returns after creating the deployment record and queue job; worker-service claims deployment_jobs for build and Cloudflare publish."]},{method:"POST",path:"/sites/:site_id/deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment from a snapshot.",status:"implemented",request_body_schema:"CreateQualityCheckDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/quality-check/status",tag:"deployments",summary:"Read the latest quality-check deployment status.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"POST",path:"/internal/site-deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/quality-check/status",tag:"deployments",summary:"Read the latest internal quality-check deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"POST",path:"/internal/site-deployments/publish",tag:"deployments",summary:"Queue a publish deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the latest current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/publish/status",tag:"deployments",summary:"Read the latest internal publish deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"GET",path:"/sites/:site_id/deployments/current",tag:"deployments",summary:"Read the latest deployment for workspace refresh recovery.",status:"implemented",response_schema:"CurrentDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/status",tag:"deployments",summary:"Read current in-flight deployment and latest released deployment.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/:deployment_id",tag:"deployments",summary:"Read one tenant-scoped deployment for status polling.",status:"implemented",response_schema:"GetDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"List CMS collections for a site.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"Create a CMS collection bound to generated content.",status:"planned"},{method:"GET",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"List CMS entries for a collection.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"Create a CMS entry.",status:"planned"},{method:"PATCH",path:"/sites/:site_id/cms/collections/:collection_id/entries/:entry_id",tag:"cms",summary:"Update a CMS entry.",status:"planned"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/version-record",tag:"versions",summary:"Record the sandbox accepted git commit for a promoted snapshot version.",status:"implemented",request_body_schema:"RecordSnapshotVersionRequestSchema",response_schema:"RecordSnapshotVersionResponseSchema"},{method:"GET",path:"/sites/:site_id/versions",tag:"versions",summary:"List snapshot-backed site versions.",status:"implemented",response_schema:"ListSiteVersionsResponseSchema"},{method:"POST",path:"/sites/:site_id/versions/:snapshot_id/restore",tag:"versions",summary:"Restore a site to an earlier snapshot version.",status:"implemented",response_schema:"RestoreSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/domains/configuration",tag:"custom-domains",summary:"Read the authoritative site domain configuration.",status:"implemented",response_schema:"GetSiteDomainConfigurationResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/active-domain",tag:"internal/active-domain",summary:"Read whether an internal site has an active primary domain.",status:"implemented",response_schema:"GetActiveSiteDomainResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/check",tag:"publish-workflow",summary:"Check a publish workflow domain and start its operation.",status:"implemented",request_body_schema:"CheckSitePublishDomainRequestSchema",response_schema:"CheckSitePublishDomainResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation",tag:"publish-workflow",summary:"Read the current publish workflow domain operation.",status:"implemented",response_schema:"GetSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation/reconcile",tag:"publish-workflow",summary:"Recover or reconcile the current publish workflow domain operation.",status:"implemented",response_schema:"ReconcileSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/remediation/confirm",tag:"publish-workflow",summary:"Confirm the current DNS remediation plan.",status:"implemented",request_body_schema:"ConfirmSitePublishDomainRemediationRequestSchema",response_schema:"ConfirmSitePublishDomainRemediationResponseSchema"},{method:"POST",path:"/sites/:site_id/integrations/gsc/auth/start",tag:"gsc",summary:"Start Google Search Console authorization for a site.",status:"implemented",request_body_schema:"StartGscAuthRequestSchema",response_schema:"StartGscAuthResponseSchema"},{method:"GET",path:"/sites/:site_id/integrations/gsc/status",tag:"gsc",summary:"Read Google Search Console authorization and property status.",status:"implemented",response_schema:"GscStatusResponseSchema"},{method:"GET",path:"/admin/tenants",tag:"admin",summary:"Admin tenant listing.",status:"planned"},{method:"GET",path:"/usage/summary",tag:"usage",summary:"Summarize tenant usage and cost controls.",status:"planned"},{method:"GET",path:"/sites/:site_id/publish-workflow/active",tag:"publish-workflow",summary:"Read the active site publish workflow.",status:"implemented",response_schema:"SitePublishWorkflowActiveResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/start",tag:"publish-workflow",summary:"Start or recover the site publish workflow.",status:"implemented",request_body_schema:"StartSitePublishWorkflowRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/repair-task",tag:"publish-workflow",summary:"Retired repair task entry: returns 409 WORKSPACE_REPAIR_REQUIRED; use the Workspace repair action.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"ApiErrorEnvelopeSchema"},{method:"GET",path:"/sites/:site_id/publish-workflow/:workflow_id",tag:"publish-workflow",summary:"Read and reconcile a site publish workflow quality task.",status:"implemented",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"PATCH",path:"/sites/:site_id/publish-workflow/:workflow_id/step",tag:"publish-workflow",summary:"Move the site publish workflow to an allowed step.",status:"implemented",request_body_schema:"UpdateSitePublishWorkflowStepRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/cancel",tag:"publish-workflow",summary:"Cancel a stable site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/publish",tag:"publish-workflow",summary:"Start formal publishing for a site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowPublishResponseSchema"}],w2=[{method:"POST",path:"/v1/agent/clarify/:site_id",tag:"clarify",summary:"Stream Step 2 clarify questions as SSE; event_order includes optional skill.selecting, skill.selected, clarify.archetype_proposals, and run.failed on errors.",status:"implemented",request_body_schema:"ClarifyRunInputSchema without tenant_id/site_id",event_schema:"ClarifyStreamEventSchema",event_order:["run.started","skill.selecting","skill.selected","clarify.partial","clarify.archetype_proposals","clarify.finished","run.failed"]},{method:"POST",path:"/v1/agent/sitemap/:site_id",tag:"sitemap",summary:"Stream Step 3 sitemap generation as SSE; event_order includes sitemap.partial and run.failed on errors.",status:"implemented",request_body_schema:"Step5SitemapStartRequestSchema (browser marker only; API injects committed Step5 strategy)",event_schema:"SitemapStreamEventSchema",event_order:["run.started","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","run.failed"]}],_k=t.object({id:t.string().min(1),role:t.enum(["system","user","assistant"]),metadata:t.unknown().optional(),parts:t.array(ki).min(1)}),xd=_k.extend({role:t.literal("user")}).superRefine((e,n)=>{let s=0;for(let[i,a]of e.parts.entries()){if(a.type!=="file")continue;s+=1;let o=a;xa.safeParse(o.mediaType).success||n.addIssue({code:"custom",path:["parts",i,"mediaType"],message:"Attachment mediaType must be image/png, image/jpeg or image/webp"}),(typeof o.url!="string"||Ea(o.url)===null)&&n.addIssue({code:"custom",path:["parts",i,"url"],message:"Attachment url must be a workspace attachment image path"})}s>ya&&n.addIssue({code:"custom",path:["parts"],message:`A message may carry at most ${ya} attachments`})}),P2=t.object({base_snapshot_id:I.optional(),intent:t.literal("navigation_adaptation").optional(),message:xd.optional(),thread_id:at.optional(),client_run_key:t.string().min(1).max(200).optional()}).superRefine((e,n)=>{us(e.message)&&n.addIssue({code:"custom",path:["message"],message:"Workspace startup message must not contain secrets",params:{errorCode:"WORKSPACE_MESSAGE_CONTAINS_SECRET"}})}),gk=t.object({path:t.string().regex(/^\/v1\/workspace\/sites\/[^/]+\/socket$/),run_id:V,base_snapshot_id:I,run_kind:Pi}),C2=t.object({agent_run:it,websocket:gk,next_step:t.literal("workspace_socket")}),v2=t.object({agent_run:it}),D2=t.object({thread_id:at.optional()}),O2=t.object({agent_run:it.nullable(),thread:Ai.nullable()}),N2=t.object({status:Yp.default("active")}),j2=t.object({threads:t.array(Ai)}),L2=t.object({title:t.string().trim().min(1).max(200)}).strict(),M2=t.object({title:t.string().trim().min(1).max(200).optional(),status:t.literal("archived").optional()}).strict().refine(e=>e.title!==void 0||e.status!==void 0,{message:"title or status is required"}),U2=t.object({thread:Ai}),F2=t.object({agent_type:t.enum(["clarify","sitemap","workspace"]),thread_id:at.optional()}),G2=t.object({agent_run:it}),q2=t.enum(["client.message.create","client.resource.operation.create","client.run.cancel","client.tool.approve","server.run.started","server.user.message","server.assistant.delta","server.tool.started","server.tool.completed","server.workspace.suggestions","workspace.plan.created","workspace.worker.updated","workspace.task.updated","server.patch.applied","server.sitemap.updated","server.snapshot.created","server.snapshot.finalized","server.preview.invalidated","preview.build.started","preview.build.succeeded","preview.build.failed","server.run.finished","server.run.failed","server.error","server.activity.started","server.activity.updated","server.activity.finished","server.activity.failed"]),de=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,run_id:V.optional(),correlation_id:t.string().min(1).optional(),seq:t.number().int().positive().optional(),sent_at:t.string().min(1)}),hk=t.object({key:t.string().min(1),label:t.string().min(1),source_file:t.string().min(1).optional(),component_name:t.string().min(1).optional(),opening_element_range:t.object({start_line:t.number().int().positive(),start_column:t.number().int().nonnegative(),end_line:t.number().int().positive(),end_column:t.number().int().nonnegative()}).optional(),structural_path:t.string().min(1).optional(),text_preview:t.string().min(1).optional()}),Sk=t.discriminatedUnion("type",[de.extend({type:t.literal("client.message.create"),payload:t.object({client_message_id:t.string().min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),current_route_id:zn.optional(),interaction_response:Gs.optional(),selected_component:hk.optional(),intent:t.literal("navigation_adaptation").optional(),display_text:t.string().min(1).max(4e3).optional(),message:xd,base_snapshot_id:I.optional()}).superRefine((e,n)=>{e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"})})}),de.extend({type:t.literal("client.run.cancel"),payload:t.object({run_id:V,reason:t.string().min(1).optional()})}),de.extend({type:t.literal("client.tool.approve"),payload:t.object({tool_call_id:t.string().min(1),decision:t.enum(["approve","reject"]),reason:t.string().min(1).optional()})}),Fc]),fk=t.discriminatedUnion("type",[de.extend({type:t.literal("server.run.started"),payload:t.object({run_id:V,agent_type:t.literal("workspace")})}),de.extend({type:t.literal("server.user.message"),payload:t.object({client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(ki).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Gs.optional()})}),de.extend({type:t.literal("server.assistant.delta"),payload:t.object({message_id:t.string().min(1),parts:t.array(ki).min(1),status:t.enum(["streaming","ready"])})}),de.extend({type:t.literal("server.tool.started"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1)})}),de.extend({type:t.literal("server.tool.completed"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:ba.optional(),interaction_failure:fa.optional()})}),de.extend({type:t.literal("server.workspace.suggestions"),payload:gd.extend({run_id:V}).strict()}),de.extend({type:t.literal("workspace.plan.created"),payload:t.object({plan_id:t.string().min(1),run_kind:Pi,groups:t.array(Jo),tasks:t.array(er),dependencies:t.array(tr),expected_outputs:t.array(Oe),diagnostics:Zo,summary:Sd})}),de.extend({type:t.literal("workspace.worker.updated"),payload:t.object({group_id:t.string().min(1),phase:Xo,status:Qt,task_counts:fd,target_paths:t.array(Oe),diagnostics:t.array(t.string().min(1))})}),de.extend({type:t.literal("workspace.task.updated"),payload:t.object({task_id:t.string().min(1),group_id:t.string().min(1),status:Qt,target_path:Oe,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(Qo).optional()})}),de.extend({type:t.literal("server.patch.applied"),payload:t.object({patch_batch_id:t.string().min(1),changed_files:t.array(t.string().min(1)),sitemap_resync_queued:t.boolean()})}),de.extend({type:t.literal("server.sitemap.updated"),payload:t.object({sitemap_id:we,version:t.number().int().positive(),reason:t.string().min(1)})}),de.extend({type:t.literal("server.snapshot.created"),payload:t.object({snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/)})}),de.extend({type:t.literal("server.snapshot.finalized"),payload:t.object({snapshot_id:I})}),de.extend({type:t.literal("server.preview.invalidated"),payload:t.object({reason:t.string().min(1),next_preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()})}),de.extend({type:t.literal("preview.build.started"),payload:t.object({snapshot_id:I})}),de.extend({type:t.literal("preview.build.succeeded"),payload:t.object({snapshot_id:I})}),de.extend({type:t.literal("preview.build.failed"),payload:t.object({snapshot_id:I,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean()})}),de.extend({type:t.literal("server.run.finished"),payload:t.object({run_id:V,snapshot_id:I,degraded_reason:Pn.optional(),build_verified:t.boolean().optional(),resource_operation:bd.optional()})}),de.extend({type:t.literal("server.run.failed"),payload:t.object({run_id:V,error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional()})}),de.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})}),de.extend({type:t.literal("server.activity.started"),payload:t.object({activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:Jp,title:t.string().min(1).max(200),title_code:Mt.optional(),detail:t.string().max(360).optional(),detail_code:Mt.optional(),locks_input:t.boolean()})}),de.extend({type:t.literal("server.activity.updated"),payload:t.object({activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),title_code:Mt.optional(),detail:t.string().max(360).optional(),detail_code:Mt.optional()})}),de.extend({type:t.literal("server.activity.finished"),payload:t.object({activity_id:t.string().min(1)})}),de.extend({type:t.literal("server.activity.failed"),payload:t.object({activity_id:t.string().min(1),detail:t.string().max(360).optional()})})]),bk=fk.superRefine((e,n)=>{if(e.type==="server.user.message"&&e.payload.interaction_response&&!e.payload.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["payload","in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="server.tool.completed")return;let s=e.payload.name==="prepare_product_search_entry",i=!!e.payload.interaction_request,a=!!e.payload.interaction_failure;(s?i!==a:!i&&!a)||n.addIssue({code:"custom",path:["payload","interaction_request"],message:s?"prepare_product_search_entry requires exactly one of interaction_request or interaction_failure":"product search interaction results are only valid for prepare_product_search_entry"})}),W2=t.union([Sk,bk]),B2={path:"/v1/workspace/sites/:site_id/socket",protocol:"ws",status:"implemented",inbound_message_schema:"WorkspaceClientMessageSchema",outbound_message_schema:"WorkspaceServerMessageSchema",query_parameters:[{name:"run_id",required:!1,schema:"string",summary:"Workspace run id returned by the API run-start response."},{name:"run_kind",required:!1,schema:"WorkspaceRunKindSchema",summary:"Workspace run mode; initial_generation can auto-start when base_snapshot_id is present."},{name:"base_snapshot_id",required:!1,schema:"string",summary:"Authoritative base snapshot id for this workspace run."},{name:"unattended",required:!1,schema:'"1"',summary:"Unattended mode for machine-driven runs: interactive tools are withheld so the run cannot stall waiting for a human answer. Server-to-server only; the browser proxy strips it."}],ai_sdk_ui_compatible:!0,notes:["Assistant UI output is carried as AI SDK UIMessage parts, including text, data-*, and tool-* parts.","Operational AgentEvents remain persisted separately for replay and audit."]},Ed=t.string().regex(/^sha256:[a-f0-9]{64}$/),yk=t.enum(["create","update","delete","str_replace"]),Rd=t.enum(["sitemap_resync","smoke_test","prepare_preview"]),xk=t.object({old_string:t.string().min(1).describe("Exact text to find in the current file. Must match the file uniquely; include enough surrounding context (usually 2-4 adjacent lines)."),new_string:t.string().describe("Replacement text. May be empty to delete the matched text."),replace_all:t.boolean().optional()}).strict(),Ek=t.object({path:Oe,operation:yk,expected_hash:Ed.optional(),full_content:t.string().describe("Complete file content for create/update patches. Only this single field is a string value: every double quote inside the source code must be escaped so the field stays valid JSON. Avoid ASCII double quotes inside JSX attribute values and use corner quotes like \u300C\u751F\u65E5\u5FEB\u4E50\u300D for visitor-facing quoted examples. The surrounding patch object and the patches array are ordinary JSON structures, not strings.").optional(),edits:t.array(xk).min(1).max(20).optional()}).strict().superRefine((e,n)=>{let s=e.full_content!==void 0;if(e.operation==="delete"){s&&n.addIssue({code:"custom",path:["full_content"],message:"delete patches must not include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"});return}if(Nk(e.path)||n.addIssue({code:"custom",path:["path"],message:"Static App Router page paths must use lowercase ASCII kebab-case public segments."}),e.operation==="str_replace"){e.full_content!==void 0&&n.addIssue({code:"custom",path:["full_content"],message:"str_replace patches must not include full_content"}),(!e.edits||e.edits.length===0)&&n.addIssue({code:"custom",path:["edits"],message:"str_replace patches must include a non-empty edits array"});return}s||n.addIssue({code:"custom",path:["full_content"],message:"create/update patches must include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"})}),Rk=t.object({kind:t.enum(["block","page","site","chrome"]),id:t.string().min(1).max(120)}),Ik=t.object({base_key:t.string().min(1).max(120).regex(/^[A-Za-z0-9._:-]+$/).refine(e=>!e.includes(".."),{message:"base_key must not contain '..'"}),owner:Rk,count:t.number().int().min(1).max(12),query:t.string().min(1).max(400),role:t.enum(["hero","section","card","gallery","testimonial","decorative","site_background","nav_background","footer_background"]),orientation:t.enum(["landscape","portrait","square"]).optional(),altHint:t.string().min(1).max(300)}),Id=t.object({site_id:k,base_snapshot_id:I,reason:t.string().min(1),patches:t.array(Ek).min(1).describe("A real JSON array of patch objects. Never JSON.stringify this array, and never put an encoded JSON array inside a string \u2014 emit the array itself. Only full_content within a patch object is a string field."),media_requests:t.array(Ik).max(24).optional(),post_actions:t.array(Rd).optional()});function Td(e,n){let s=new Set;for(let[i,a]of e.patches.entries())s.has(a.path)&&n.addIssue({code:"custom",path:["patches",i,"path"],message:`Duplicate patch path: ${a.path}`}),s.add(a.path)}var K2=Id.superRefine(Td),z2=Id.omit({base_snapshot_id:!0}).extend({site_id:k.optional()}).superRefine(Td),Tk=Ie,kk=t.object({path:Tk,operation:t.enum(["upsert","delete"]).optional()}),kd=t.enum(["sync_cms_pages","sync_cms_navigation"]),H2=t.object({files:t.array(kk).min(1),post_actions:t.array(kd).optional()}).strict().overwrite(e=>e.post_actions?{...e,post_actions:[...new Set(e.post_actions)]}:e),Ak=t.enum(["BASE_SNAPSHOT_NOT_FOUND","PATCH_TARGET_NOT_FOUND","PATCH_TARGET_ALREADY_EXISTS","PATCH_EXPECTED_HASH_MISMATCH","PATCH_DIFF_UNSUPPORTED","PATCH_PROTECTED_FILE","PATCH_VALIDATION_FAILED","PATCH_MEDIA_REFERENCE_NOT_DECLARED","PATCH_BATCH_INVALID","PATCH_BATCH_FAILED","PATCH_BATCH_TOO_LARGE","STR_REPLACE_NOT_FOUND","STR_REPLACE_NOT_UNIQUE","STR_REPLACE_BINARY_FILE","STR_REPLACE_REQUIRES_READ","GLOBALS_CSS_EDIT_REJECTED"]),wk=t.object({status:t.literal("applied"),patch_batch_id:t.string().min(1),site_id:k,base_snapshot_id:I,snapshot_id:I,manifest_hash:Ed,object_key:t.string().min(1),changed_files:t.array(Oe).min(1),post_actions_queued:t.array(Rd),dropped_protected_files:t.array(t.string().min(1)).min(1).optional()}),Pk=t.object({status:t.literal("failed"),code:Ak,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),$2=t.discriminatedUnion("status",[wk,Pk]),V2=t.object({ok:t.literal(!0),post_actions:t.array(t.object({action:kd,status:t.enum(["succeeded","failed"])}).strict()).default([])}),Ad=Ie,Ck=t.enum(["text","binary"]),wd=t.object({path:Ad,kind:Ck,language:t.string().min(1).nullable(),size_bytes:t.number().int().nonnegative()}),Y2=t.object({path:Ad}),vk=wd.extend({kind:t.literal("text"),language:t.string().min(1),content:t.string()}),Dk=wd.extend({kind:t.literal("binary"),language:t.null(),mime_type:t.string().min(1),content_base64:t.string().min(1)}),X2=t.union([vk,Dk]);function us(e){return typeof e=="string"?/authorization\s*:|bearer\s+|token\s*=|secret\s*=|api[_-]?key\s*=|access[_\s-]?key\s*=|\bsk-[a-z0-9_-]{20,}|eyJ[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}/i.test(e):!e||typeof e!="object"?!1:Array.isArray(e)?e.some(n=>us(n)):Object.entries(e).some(([n,s])=>Ok(n)||us(s))}function Ok(e){let n=e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase();return/(^|[_-])(authorization|token|secret|api[_-]?key|apikey|access[_-]?key|accesskey)([_-]|$)/.test(n)}function Pd(e){let n=e.split("/");return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&n.every(s=>s!==""&&s!=="."&&s!=="..")}function Nk(e){if(/^(?:src\/)?app\/\.vcp\//.test(e))return hs(e);let n=/^app\/(?:(.*)\/)?page\.(?:tsx|jsx)$/.exec(e);if(!n)return!0;let i=(n[1]??"").split("/").filter(o=>o.length>0);return i.some(o=>o.startsWith("_"))?!0:i.filter(o=>!o.startsWith("@")&&!/^\(.+\)$/.test(o)).map(o=>o.replace(/^\((?:\.|\.\.|\.\.\.)\)/,"")).filter(o=>o.length>0).every(o=>/^\[.*\]$/.test(o)||Gn.test(`/${o}`))}var Cd=t.enum(["idle","creating","restoring_snapshot","installing_dependencies","starting_preview","ready","active","stopping","stopped","failed"]),wn=t.object({id:Jt,tenant_id:t.string().min(1),site_id:k,sandbox_id:t.string().min(1).nullable(),status:Cd,source_snapshot_id:I.nullable(),last_snapshot_id:I.nullable(),preview_url:t.string().url().nullable(),browser_preview_url:t.string().url().nullable().optional(),launch_id:t.string().min(1).nullable().optional(),last_activity_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),Q2=t.object({session_id:Jt.optional(),sandbox_id:t.string().min(1).optional(),source_snapshot_id:I.optional(),last_snapshot_id:I,expected_current_snapshot_id:I.optional(),expected_ready_session_id:Jt.optional(),expected_ready_session_last_snapshot_id:I.optional(),status:Cd,preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()}),Z2=t.object({preview_session:wn,next_step:t.literal("preview")}),J2=t.object({failed_count:t.number().int().nonnegative()}),eW=t.object({site_id:k}),tW=t.object({status:t.enum(["cancelled","stop_requested","no_active_run"]),agent_run:it.nullable()});export{tl as AESTHETIC_NOTE_MAX_LENGTH,Co as AI_IMAGE_GENERATION_MAX_QUANTITY,Dy as APPLICATION_LIBRARY_ERROR_CODES,lq as AbandonSiteSnapshotResponseSchema,aR as ActiveSiteDomainDataSchema,O2 as ActiveWorkspaceRunResponseSchema,Jp as ActivityKindSchema,Mt as ActivityTitleCodeSchema,eP as AdvanceSiteWorkflowRequestSchema,zp as AgentErrorCategorySchema,ir as AgentEventIdSchema,Uo as AgentEventRecordSchema,yd as AgentEventSchema,hd as AgentEventTypeSchema,ZT as AgentMessageHistoryPurposeSchema,Vp as AgentModelRouteSchema,JT as AgentPlanStepSchema,sq as AgentRunContextResponseSchema,V as AgentRunIdSchema,$p as AgentRunKindSchema,it as AgentRunRecordSchema,zI as AgentRunStatusSchema,Hp as AgentRunTypeSchema,at as AgentThreadIdSchema,HI as AgentThreadKindSchema,$I as AgentThreadOriginSchema,Ai as AgentThreadRecordSchema,Yp as AgentThreadStatusSchema,ok as AiSdkUiDataPartSchema,ck as AiSdkUiErrorPartSchema,sk as AiSdkUiFilePartSchema,ki as AiSdkUiMessagePartSchema,_k as AiSdkUiMessageSchema,nk as AiSdkUiReasoningPartSchema,ak as AiSdkUiSourceDocumentPartSchema,ik as AiSdkUiSourceUrlPartSchema,mk as AiSdkUiStepStartPartSchema,tk as AiSdkUiTextPartSchema,rk as AiSdkUiToolPartSchema,T2 as ApiContractStatusSchema,tT as ApiErrorEnvelopeSchema,U as ApiResponseSchema,y2 as AppendAgentEventRequestSchema,x2 as AppendAgentEventResponseSchema,Xj as ApplicationCreateResponseSchema,My as ApplicationLibraryApplicationSchema,Qj as ApplicationLibraryApplicationsDataSchema,cl as ApplicationLibraryErrorCodeSchema,Jj as ApplicationLibraryErrorResponseSchema,Zj as ApplicationLibraryTemplatesDataSchema,ll as ApplicationTemplateCatalogDataSchema,Oy as ApplicationTemplateCatalogItemSchema,vy as ApplicationTemplateConsumeDataSchema,Yj as ApplicationTemplateCreateRequestSchema,jy as ApplicationTemplateCreateResponseSchema,Ny as ApplicationTemplateCreatedApplicationSchema,oi as ApplicationTemplateDigestSchema,ky as ApplicationTemplateFieldSchema,Cy as ApplicationTemplateReferenceSchema,Ly as ApplicationTemplateSourceSchema,ri as ApplicationTemplateStableKeySchema,so as ApplicationTemplateV1Schema,Ak as ApplyPatchBatchErrorCodeSchema,Pk as ApplyPatchBatchFailureSchema,K2 as ApplyPatchBatchInputSchema,Ek as ApplyPatchBatchPatchSchema,Rd as ApplyPatchBatchPostActionSchema,$2 as ApplyPatchBatchResultSchema,wk as ApplyPatchBatchSuccessSchema,z2 as ApplyPatchBatchToolInputSchema,xk as ApplyPatchEditSchema,yk as ApplyPatchOperationSchema,Kp as ArchetypeProposalSchema,Yk as AuditLogIdSchema,Mk as AuthIdentityIdSchema,qk as AuthLoginCodeIdSchema,Gk as AuthOidcStateIdSchema,zF as AuthProfileSchema,Uk as AuthSessionIdSchema,Fk as AuthTokenIdSchema,Wk as AuthWsTicketIdSchema,Fx as BINDING_STATUSES,ed as BlockGenerationContextSchema,fs as BlockInteractionSchema,Wq as BlockMediaIntentSchema,Ho as BlockSchema,uf as BlockingSubsiteSchema,td as BrandingSchema,Zt as BriefIdSchema,Bo as BriefRecordSchema,yr as BusinessFactsSchema,hO as CHAT_COPY,gO as CLARIFICATION_COPY,px as CMS_FORM_FIELD_TYPES,Km as CMS_MAIN_PRODUCTS_MAX_LENGTH,g_ as CMS_PAGE_DIRECTORY_MAX_DEPTH,__ as CMS_PAGE_DIRECTORY_MAX_NODES,u_ as CMS_PAGE_URL_MAX_LENGTH,Yr as CMS_PAGE_URL_PATH_MAX_LENGTH,Nv as COMPONENT_I18N_FILE_SUFFIX,$s as COMPONENT_I18N_NAMESPACE,Qd as CONVERSION_CTA_LABEL_MAX_LENGTH,iE as CRAWLER_INTERNAL_ERROR_CODES,Fm as CURRENT_EDIT_ENGINE_VERSION,eW as CancelActiveWorkspaceRunRequestSchema,tW as CancelActiveWorkspaceRunResponseSchema,d1 as CheckDesignerPageProjectionRequestSchema,u1 as CheckDesignerPageProjectionResponseSchema,w_ as CheckDesignerPageProjectionResultSchema,ap as CheckSitePublishDomainDataSchema,QE as CheckSitePublishDomainRequestSchema,ZE as CheckSitePublishDomainResponseSchema,nd as ChromeDesignSchema,_T as ChromeFooterDesignSchema,uT as ChromeFooterShellSchema,pT as ChromeHeaderDesignSchema,lT as ChromeHeaderShellSchema,gT as ChromeMobileNavDesignSchema,Od as ClaimPreviewSandboxCleanupsRequestSchema,Nd as ClaimPreviewSandboxCleanupsResponseSchema,Iv as ClaimStaleWorkspaceRunsResponseSchema,BI as ClarifyQuestionOptionSchema,KI as ClarifyQuestionSchema,GI as ClarifyQuestionTypeSchema,qo as ClarifyQuestionsSchema,wG as ClarifyRunInputSchema,nr as ClarifySessionIdSchema,HT as ClarifySessionRecordSchema,PG as ClarifyStreamEventSchema,oL as CmsApplicationCoreInputSchema,rL as CmsApplicationCoreResultSchema,cL as CmsApplicationSeedInputSchema,mL as CmsApplicationSeedResultSchema,Xk as CmsCollectionBindingIdSchema,mM as CmsCollectionBindingSchema,Rl as CmsFormSchemaProjectionSchema,Ji as CmsManagedPageTypeSchema,FF as CmsNavigationActionSchema,UF as CmsNavigationCapabilitiesResponseSchema,II as CmsNavigationCapabilitiesSchema,Op as CmsNavigationCreateGroupBodySchema,jp as CmsNavigationCreateItemBodySchema,LF as CmsNavigationDefaultGroupBodySchema,vo as CmsNavigationDraftItemSchema,yI as CmsNavigationEditorContextSchema,jF as CmsNavigationEditorResponseSchema,bI as CmsNavigationGroupSchema,Dp as CmsNavigationItemSchema,RI as CmsNavigationMoveItemBodySchema,xI as CmsNavigationPatchGroupBodySchema,EI as CmsNavigationPatchItemBodySchema,MF as CmsNavigationSaveItemsBodySchema,Do as CmsNavigationTargetTypeSchema,f_ as CmsPageDirectoryGroupSchema,Qr as CmsPageDirectoryNodeSchema,$r as CmsPageDirectorySchema,ea as CmsPageTypeSchema,Kt as CmsPageUrlPathSchema,f1 as CmsSeoSyncStateSchema,Ts as CmsSiteIdSchema,tE as CompanyInfoSchema,kM as CompanyInfoTaskCreateRequestSchema,AM as CompanyInfoTaskCreateResponseSchema,wM as CompanyInfoTaskResponseSchema,ij as CompleteCustomerMaterialsRequestSchema,aj as CompleteDiagnosisRequestSchema,jd as CompletePreviewSandboxCleanupRequestSchema,Ld as CompletePreviewSandboxCleanupResponseSchema,nP as CompleteQualityOnlyWorkflowRequestSchema,dq as CompleteSiteSnapshotDeletionResponseSchema,tP as CompleteSiteWorkflowRequestSchema,oj as CompleteStrategyRequestSchema,sj as CompleteWebsiteScanRequestSchema,Lv as ComponentI18nResourcesSchema,C1 as ComposeDesignerPageResourceBodySchema,r0 as ComputeSnapshotEditChangesRequestSchema,c0 as ComputeSnapshotEditChangesResponseSchema,eR as ConfirmSitePublishDomainRemediationDataSchema,JE as ConfirmSitePublishDomainRemediationRequestSchema,tR as ConfirmSitePublishDomainRemediationResponseSchema,c2 as ConfirmSiteStructureRequestSchema,zj as ConnectDynamicCollectionInputSchema,SL as ConnectFormInputSchema,Gt as ConversionHintsSchema,aE as CrawlerInternalErrorCodeSchema,PM as CrawlerInternalErrorSchema,fn as CrawlerTaskCodeSchema,SM as CrawlerTaskCreateRequestSchema,yM as CrawlerTaskCreateResponseSchema,$x as CrawlerTaskFailureErrorCodeSchema,Ul as CrawlerTaskFailureStageSchema,Yx as CrawlerTaskPageSchema,fM as CrawlerTaskPagesQuerySchema,RM as CrawlerTaskPagesResponseSchema,EM as CrawlerTaskStatusResponseSchema,Yt as CrawlerTaskUuidSchema,Gq as CreateAgentRunConflictResponseSchema,iq as CreateAgentRunRequestSchema,aq as CreateAgentRunResponseSchema,vq as CreateDeploymentRequestSchema,QI as CreateDeploymentResponseSchema,z0 as CreateDocumentUploadRequestSchema,a0 as CreateExternalSiteEditRequestSchema,m0 as CreateExternalSiteEditResponseSchema,Q0 as CreateImageUploadRequestSchema,G0 as CreateInputSourceRequestSchema,Dq as CreateQualityCheckDeploymentRequestSchema,MG as CreateSiteBriefRequestSchema,JG as CreateSiteBriefResponseSchema,UG as CreateSiteDraftRequestSchema,LG as CreateSiteInputSchema,L2 as CreateSiteThreadRequestSchema,Zw as CreateSiteWorkflowRequestSchema,ru as CreateTextInputSourceRequestSchema,cu as CreateUrlInputSourceRequestSchema,Nq as CurrentDeploymentResponseSchema,QN as CustomerMaterialsDraftResponseSchema,$a as CustomerMaterialsDraftSchema,ZN as CustomerMaterialsNullableResponseSchema,Va as CustomerMaterialsRecordSchema,XN as CustomerMaterialsResponseSchema,cy as CustomerMaterialsStatusSchema,bS as DEFAULT_FONTS,Vm as DEFAULT_SITE_DESIGN_RADIUS_ID,Uu as DEFAULT_SITE_LOCALE,AO as DEFAULT_SUBSITE_PALETTE,Ks as DEFAULT_WEIGHT_STYLE_ID,gC as DEPLOYMENT_ACTIVE_STATUSES,Pt as DEPLOYMENT_LIFECYCLE_TRANSITIONS,Ph as DEPLOYMENT_PROGRESS_STEP_CODES,eT as DEPLOYMENT_REALTIME_CHANNEL,en as DEPLOYMENT_STATUSES,hC as DEPLOYMENT_TERMINAL_STATUSES,uS as DEPLOYMENT_TRANSITION_ERROR_CODE,Fq as DEPLOYMENT_WEBSOCKET_CONTRACT,ef as DESIGNER_BRIDGE_TELEMETRY_MAX_EVENTS,QA as DESIGNER_COMPONENT_LIBRARY_ERROR_CODES,T1 as DESIGNER_PAGE_LIBRARY_ERROR_CODES,q0 as DOCUMENT_EXTENSION_WHITELIST,W0 as DOCUMENT_MIME_WHITELIST,kE as DOMAIN_DNS_PURPOSES,PE as DOMAIN_DNS_REMEDIATION_STATUSES,AE as DOMAIN_DNS_VERIFICATION_STATUSES,EE as DOMAIN_OBSERVED_STATUSES,IE as DOMAIN_ROUTING_MODES,_1 as DeleteDesignerPageErrorDetailsSchema,c1 as DeleteDesignerPageRequestSchema,m1 as DeleteDesignerPageResponseSchema,k_ as DeleteDesignerPageResultSchema,pq as DeleteSiteSnapshotResponseSchema,dt as DeploymentIdSchema,Bk as DeploymentJobIdSchema,Ch as DeploymentProgressStepCodeSchema,Dh as DeploymentProgressStepSchema,vh as DeploymentProgressStepStatusSchema,Jc as DeploymentProgressStepsSchema,Lt as DeploymentRecordSchema,Uq as DeploymentRedisPubSubEventSchema,Ko as DeploymentStatusSchema,Gp as DeploymentStatusSummarySchema,wa as DeploymentTransitionError,Qp as DeploymentTypeSchema,Ii as DeploymentWsDeploymentPayloadSchema,Mq as DeploymentWsServerMessageSchema,JI as DeploymentWsServerMessageTypeSchema,XT as DesignPlanGenerationOutcomeSchema,QT as DesignPlanGenerationReasonSchema,Ci as DesignPlanIdSchema,zq as DesignPlanPatchSchema,$T as DesignPlanRecordSchema,id as DesignPlanSchema,qe as DesignTokenBlockError,qq as DesignTokensSchema,vv as DesignerBridgeTelemetryBatchSchema,nf as DesignerBridgeTelemetryEventSchema,tf as DesignerBridgeTelemetryEventTypeSchema,d_ as DesignerComponentCatalogItemSchema,Br as DesignerComponentCategoriesDataSchema,Wr as DesignerComponentCategoryNodeSchema,Bt as DesignerComponentExactVersionSchema,zr as DesignerComponentInstallDataSchema,Kr as DesignerComponentsDataSchema,O_ as DesignerPageCatalogItemSchema,ac as DesignerPageCategoriesDataSchema,ic as DesignerPageCategoryNodeSchema,R_ as DesignerPageDeleteBlockReasonSchema,E_ as DesignerPageDisabledReasonSchema,Fn as DesignerPageExactVersionSchema,tc as DesignerPageGroupSchema,rc as DesignerPageInstallDataSchema,ec as DesignerPageNodeSchema,mc as DesignerPageResourcePreparationDataSchema,D_ as DesignerPageResourceSourceSchema,G_ as DesignerPageResourceTemplateSchema,zt as DesignerPageResourceTypeSchema,oc as DesignerPagesDataSchema,Vi as DesignerResourceVersionSchema,lc as DesignerSitePagesDataSchema,A1 as DesignerSiteRouteIdSchema,ep as DomainConfigurationSchema,yo as DomainDnsPurposeSchema,jE as DomainDnsRecordSchema,NE as DomainDnsRemediationChangeSchema,Ql as DomainDnsRemediationRecordSchema,Zl as DomainDnsRemediationResultSchema,CE as DomainDnsRemediationStatusSchema,OE as DomainDnsVerificationObservationSchema,Xl as DomainDnsVerificationResultSchema,wE as DomainDnsVerificationStatusSchema,RE as DomainObservedStatusSchema,DE as DomainOperationErrorSchema,fi as DomainOperationSchema,vE as DomainOperationStatusSchema,xo as DomainOperationTypeSchema,Jl as DomainRecordSchema,TE as DomainRoutingModeSchema,fO as EDIT_ENGINE_VERSION_HEADER,bO as EDIT_ENGINE_VERSION_SOURCE_HEADER,o0 as EMPTY_EXTERNAL_SITE_EDIT_CHANGES,pO as ERROR_COPY,Fd as EXTERNAL_SITE_EDIT_INFRASTRUCTURE_REASONS,Ud as EXTERNAL_SITE_EDIT_PROMPT_MAX_LENGTH,za as EditEngineVersionParseError,pc as EnhanceDesignerPageResourceBodySchema,QG as EnhanceDesignerPageResourceResponseSchema,QF as EnsureSiteInitialReviewRequestSchema,d0 as ExternalSiteEditCallbackAckSchema,p0 as ExternalSiteEditCallbackPayloadSchema,Gd as ExternalSiteEditCallbackStatusSchema,Di as ExternalSiteEditChangeKindSchema,dr as ExternalSiteEditChangesSchema,Pn as ExternalSiteEditDegradedReasonSchema,Ft as ExternalSiteEditExternalIdSchema,cr as ExternalSiteEditOutcomeSchema,Yd as ExternalSiteEditPageChangeSchema,Wd as ExternalSiteEditPageTypeSchema,Vd as ExternalSiteEditSectionChangeSchema,Kd as ExternalSiteEditSiteWideChangeSchema,Bd as ExternalSiteEditSiteWideKindSchema,rr as ExternalSiteEditTaskIdSchema,gs as ExternalSiteEditTaskSchema,qd as ExternalSiteEditTaskStatusSchema,WG as ExternalSyncSiteRequestSchema,ZG as ExternalSyncSiteResponseSchema,iu as ExtractedFactKindSchema,bs as ExtractedFactSchema,no as FIELD_TYPES,hv as FILL_IN_NOT_AVAILABLE_ERROR_CODE,fv as FILL_IN_TARGET_MODIFIED_ERROR_CODE,Sv as FILL_IN_TARGET_NOT_OMITTED_ERROR_CODE,ob as FONT_LICENSE_BUILD_ERROR_CODES,dm as FONT_PAIRINGS,va as FONT_PAIRING_IDS,Rx as FORM_DESIGN_ERROR_CODES,Ex as FORM_DESIGN_FAILURE_STAGES,yx as FORM_DESIGN_OPERATION_STAGES,xx as FORM_DESIGN_OPERATION_STATUSES,mi as FORM_FIELD_TYPES,_l as FORM_SCENE_CODES,gl as FORM_SCENE_UNKNOWN,Wy as FORM_SHAPE_EMBEDDED,dx as FORM_SPEC_FIELD_TYPE_TO_CMS,Sl as FORM_SPEC_FILE_MIN_RUNTIME_VERSION,sx as FORM_SPEC_LOCALIZABLE_FIELD_PATHS,hl as FORM_SPEC_MULTISTEP_MIN_RUNTIME_VERSION,PL as FORM_TEMPLATE_CATEGORY_COUNTS,wL as FORM_TEMPLATE_CATEGORY_SLUGS,J2 as FailStaleInFlightWorkspaceRunsResponseSchema,ai as FieldDeclSchema,Tm as FillInTargetSchema,FM as FirecrawlBatchCreateRequestSchema,GM as FirecrawlBatchCreatedResponseSchema,cE as FirecrawlBatchErrorSchema,WM as FirecrawlBatchErrorsResponseSchema,rE as FirecrawlBatchPageSchema,qM as FirecrawlBatchStatusResponseSchema,NM as FirecrawlCrawlCreateRequestSchema,jM as FirecrawlCrawlCreatedResponseSchema,LM as FirecrawlCrawlStatusResponseSchema,Bl as FirecrawlJobStatusSchema,DM as FirecrawlMapRequestSchema,OM as FirecrawlMapResponseSchema,BM as FirecrawlQueueStatusResponseSchema,MM as FirecrawlScrapeRequestSchema,UM as FirecrawlScrapeResponseSchema,dT as FooterShellSurfaceSchema,$y as FormBlockIdSchema,pi as FormDefinitionIdSchema,Sx as FormDesignAffectedFilesSchema,So as FormDesignErrorCodeSchema,WL as FormDesignErrorSchema,kl as FormDesignFailureStageSchema,ue as FormDesignHashSchema,jL as FormDesignOpenResponseSchema,fx as FormDesignOperationFingerprintInputSchema,lo as FormDesignOperationIdSchema,Al as FormDesignOperationNextActionSchema,zk as FormDesignOperationRecordIdSchema,GL as FormDesignOperationRecordSchema,fo as FormDesignOperationResponseSchema,Pl as FormDesignOperationSchema,ho as FormDesignOperationStageSchema,Tl as FormDesignOperationStatusSchema,qL as FormDesignOperationTransitionRequestSchema,wl as FormDesignPreviewRefreshStatusSchema,ML as FormDesignQueryResponseSchema,UL as FormDesignResumeRequestSchema,FL as FormDesignResumeResponseSchema,bx as FormDesignSaveRequestSchema,LL as FormDesignSaveResponseSchema,Il as FormDesignSharedImpactSchema,go as FormDesignStandardizationSchema,zy as FormFieldDeclSchema,cs as FormFieldNameSchema,ro as FormMetadataSchema,po as FormOptionValueSchema,oo as FormSceneSchema,By as FormShapeSchema,Vy as FormSpecBindingSchema,Xy as FormSpecFieldNodeSchema,Zy as FormSpecNodeSchema,Yy as FormSpecOptionSchema,Qy as FormSpecStepBreakNodeSchema,_o as FormSpecV1Schema,CL as FormTemplateCatalogResponseSchema,El as FormTemplateCategorySlugSchema,mx as FormTemplateCategoryV1Schema,Nt as FormTemplateTextSchema,lx as FormTemplateV1Schema,_R as GA4_AUTHORIZATION_STATUSES,hR as GA4_AUTH_ATTEMPT_STATUSES,ER as GA4_BINDING_REASONS,fR as GA4_BINDING_STATUSES,yR as GA4_VERIFICATION_STATUSES,Yn as GLOBAL_DESIGN_TOKENS_END,dn as GLOBAL_DESIGN_TOKENS_START,oR as GSC_AUTH_STATUSES,rR as GSC_BINDING_STATUSES,cR as GSC_PROPERTY_TYPES,DR as Ga4AccountOptionSchema,lp as Ga4AuthAttemptSchema,SR as Ga4AuthAttemptStatusSchema,TR as Ga4AuthorizationSchema,gR as Ga4AuthorizationStatusSchema,RR as Ga4BindingReasonSchema,kR as Ga4BindingSchema,bR as Ga4BindingStatusSchema,NR as Ga4DataStreamOptionSchema,jR as Ga4DataStreamsDataSchema,_F as Ga4DataStreamsQuerySchema,uF as Ga4DataStreamsResponseSchema,CR as Ga4DeploymentSchema,wR as Ga4ModeSchema,LR as Ga4MutationSchema,vR as Ga4PropertyOptionSchema,OR as Ga4SetupResourcesDataSchema,dF as Ga4SetupResourcesQuerySchema,pF as Ga4SetupResourcesResponseSchema,pp as Ga4StatusDataSchema,lF as Ga4StatusQuerySchema,mF as Ga4StatusResponseSchema,PR as Ga4TrackingSchema,AR as Ga4VerificationSchema,xR as Ga4VerificationStatusSchema,aI as GenerateAiImagesRequestSchema,oI as GenerateAiImagesResponseSchema,Pp as GeneratedAiImageResultSchema,DU as GetActiveSiteDomainResponseSchema,jq as GetDeploymentResponseSchema,ZI as GetDeploymentsStatusResponseSchema,l0 as GetExternalSiteEditResponseSchema,vU as GetSiteDomainConfigurationResponseSchema,TN as GetSiteLauncherPermissionResponseSchema,Eo as GetSitePublishDomainOperationDataSchema,nR as GetSitePublishDomainOperationResponseSchema,mN as GetTemplateUpgradeReportQuerySchema,lN as GetTemplateUpgradeReportResponseSchema,JU as GoogleSearchConsoleAuthStartDataSchema,ZU as GoogleSearchConsoleAuthStartRequestSchema,eF as GoogleSearchConsoleAuthStartResponseSchema,VU as GoogleSearchConsoleAuthStatusSchema,YU as GoogleSearchConsoleBindingStatusSchema,XU as GoogleSearchConsolePropertyTypeSchema,QU as GoogleSearchConsoleStateSchema,nF as GoogleSearchConsoleStatusDataSchema,tF as GoogleSearchConsoleStatusInputSchema,sF as GoogleSearchConsoleStatusResponseSchema,zU as GscAuthStartDataSchema,KU as GscAuthStartRequestSchema,HU as GscAuthStartResponseSchema,Ro as GscAuthStatusSchema,Io as GscBindingStatusSchema,To as GscPropertyTypeSchema,lR as GscStateInputSchema,$U as GscStateSchema,cp as GscStatusDataSchema,pR as GscStatusResponseSchema,Vr as HOME_PAGE_URL_PATH,cT as HeaderShellBehaviorSchema,mT as HeaderShellShapeSchema,rT as HeaderShellSurfaceSchema,oT as HeaderShellVariantSchema,qx as HomeUrlCrawlerTaskCreateRequestSchema,da as HttpUrlSchema,$0 as IMAGE_EXTENSION_WHITELIST,V0 as IMAGE_MIME_WHITELIST,qr as INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY,sc as INSERT_NEW_PAGE_CATEGORY_GROUP_KEY,av as INTERNAL_RUN_LEASE_OWNER_HEADER,Fu as ISO_639_3_TO_SITE_LOCALE,mu as ImageRoleSchema,xd as InboundUserMessageSchema,jj as IndustryClassificationRequestSchema,Lj as IndustryClassificationResultSchema,xy as IndustryConfidenceSchema,ml as InitializationResultSchema,su as InputBundleStatusSchema,xs as InputConflictSchema,Z0 as InputContextBundleSchema,An as InputContextSourceIdSchema,ou as InputSourceSchema,Ni as InputSourceStatusSchema,Oi as InputSourceTypeSchema,QO as InspectTemplateUpgradeStateRequestSchema,ZO as InspectTemplateUpgradeStateResponseSchema,t1 as InstallDesignerComponentBodySchema,zG as InstallDesignerComponentResponseSchema,w1 as InstallDesignerPageBodySchema,VG as InstallDesignerPageResponseSchema,Oq as InternalCreateDeploymentResponseSchema,Aq as InternalEnsureSubsitePublishRequestSchema,wq as InternalEnsureSubsitePublishResponseSchema,Z as InternalEntityIdSchema,Lq as InternalGetDeploymentsStatusResponseSchema,Pq as InternalGetSubsitePublishStatusRequestSchema,Cq as InternalGetSubsitePublishStatusResponseSchema,Tq as InternalPrepareSubsitePreviewRequestSchema,kq as InternalPrepareSubsitePreviewResponseSchema,ay as KNOWLEDGE_CATEGORY_CODES,zm as KnowledgeCategoryCodeSchema,KN as KnowledgeContextReadinessSchema,ry as KnowledgeSourceReadinessSchema,oy as KnowledgeSourceReadinessStatusSchema,zl as LEGACY_FILE_MUTATION_TOOL_NAME,Ou as LEGACY_SITE_LOCALE_CODES,F2 as LatestAgentRunQuerySchema,G2 as LatestAgentRunResponseSchema,D2 as LatestWorkspaceRunQuerySchema,v2 as LatestWorkspaceRunResponseSchema,JM as LauncherPromptTemplateApplyRequestSchema,eU as LauncherPromptTemplateApplyResponseSchema,gE as LauncherPromptTemplateCatalogItemSchema,QM as LauncherPromptTemplateCatalogQuerySchema,ZM as LauncherPromptTemplateCatalogSchema,uE as LauncherPromptTemplateKindSchema,_E as LauncherPromptTemplateLocaleSchema,Si as LauncherPromptTemplateTypeSchema,Xb as LauncherScopeSchema,R2 as ListAgentEventsQuerySchema,E2 as ListAgentEventsResponseSchema,BG as ListDesignerComponentCategoriesResponseSchema,e1 as ListDesignerComponentsQuerySchema,KG as ListDesignerComponentsResponseSchema,HG as ListDesignerPageCategoriesResponseSchema,k1 as ListDesignerPagesQuerySchema,$G as ListDesignerPagesResponseSchema,XG as ListDesignerSitePagesResponseSchema,nI as ListMediaLibraryAssetsQuerySchema,sI as ListMediaLibraryAssetsResponseSchema,I2 as ListSiteAgentEventsQuerySchema,Eq as ListSiteVersionsResponseSchema,pN as ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema,dN as ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema,Ev as ListWorkspacePageCheckpointsResponseSchema,K0 as MAX_DOCUMENT_SOURCES_PER_SITE,B0 as MAX_DOCUMENT_UPLOAD_BYTES,X0 as MAX_IMAGE_SOURCES_PER_SITE,Y0 as MAX_IMAGE_UPLOAD_BYTES,YR as MAX_NAV_LABEL_WIDTH,yb as MAX_SUBSITE_MEDIA_REPLACEMENTS,yP as MAX_UNBOUND_WORKSPACE_ATTACHMENTS_PER_SITE,ya as MAX_WORKSPACE_ATTACHMENTS_PER_MESSAGE,AP as MAX_WORKSPACE_URL_CAPTURES_PER_SITE_HOUR,xp as MEDIA_LIBRARY_AUDIO_EXTENSIONS,kp as MEDIA_LIBRARY_AUDIO_MIME_TYPES,Ep as MEDIA_LIBRARY_DOCUMENT_EXTENSIONS,eI as MEDIA_LIBRARY_EXTENSIONS,Rp as MEDIA_LIBRARY_FILE_EXTENSIONS,bp as MEDIA_LIBRARY_IMAGE_EXTENSIONS,JR as MEDIA_LIBRARY_IMAGE_MAX_BYTES,Ip as MEDIA_LIBRARY_IMAGE_MIME_TYPES,fp as MEDIA_LIBRARY_MAX_BYTES,tI as MEDIA_LIBRARY_MIME_TYPES,yp as MEDIA_LIBRARY_VIDEO_EXTENSIONS,Tp as MEDIA_LIBRARY_VIDEO_MIME_TYPES,Fv as MIGRATION_PRODUCTS_CMS_DETAIL_PAGE_TITLE,Uv as MIGRATION_PRODUCTS_DETAIL_PREFIX,Wv as MIGRATION_PRODUCTS_DETAIL_VIEW_VARIANT,qv as MIGRATION_PRODUCTS_LIST_VIEW_VARIANT,of as MIGRATION_PRODUCTS_ROUTE,yt as MIGRATION_PRODUCTS_SLUG,Gv as MIGRATION_PRODUCTS_VIEW_BLOCK_TYPE,Ky as MODEL_DECLARABLE_FORM_FIELD_TYPES,Kl as MODEL_FILE_MUTATION_TOOL_NAMES,my as MOTION_PRESETS,Xa as MOTION_PRESET_IDS,Kq as MediaAssetSchema,iT as MediaAttributionSchema,Po as MediaLibraryAssetSchema,Ap as MediaLibraryFileTypeSchema,wp as MediaLibrarySourceSchema,Rk as MediaRequestOwnerSchema,Vk as MediaResolutionCacheIdSchema,kI as MigrationCollectionProgressSchema,jo as MigrationCollectionSchema,WF as MigrationContentProgressSchema,TI as MigrationReasonCodeSchema,wI as MigrationRedirectProgressSchema,AI as MigrationRedirectReasonCodeSchema,Lp as MigrationRedirectSiteReasonSchema,JA as MockDesignerComponentInsertDataSchema,ZA as MockDesignerComponentInsertRequestSchema,Go as MotionLevelSchema,vx as NAV_ITEMS_LOCALIZABLE_FIELD_PATHS,Dx as NAV_ITEMS_MACHINE_FIELD_PATHS,ES as NEXT_FONT_DISPLAY_NAMES,bt as NEXT_FONT_REGISTRY,Gu as NON_LATIN_SITE_LOCALE_CODES,ZL as NavItemSchema,Gi as NextPageCodeErrorSchema,Ax as PAGE_SEO_LOCALIZABLE_FIELD_PATHS,wx as PAGE_SEO_MACHINE_FIELD_PATHS,Gn as PAGE_SLUG_PATTERN,an as PAGE_SLUG_SEGMENT_PATTERN_SOURCE,gr as PAGE_TEMPLATE_BATCH_MAX_ITEMS,lE as PLATFORM_FILE_MUTATION_TOOL_NAMES,iM as PLATFORM_MATERIALIZED_EXEMPTIONS,Lx as PLATFORM_MATERIALIZED_FILES,Mx as PLATFORM_MATERIALIZED_FILE_PATTERNS,sM as PLATFORM_MATERIALIZERS,dc as PLATFORM_OWNED_PAGE_SLUGS,q_ as PLATFORM_OWNED_ROUTE_FILE_PATHS,Dd as PREVIEW_SANDBOX_CLEANUP_CONFLICT_ERROR_CODE,or as PREVIEW_SANDBOX_CLEANUP_LIMIT,T_ as PageDirectoryReconcileFailedPageSchema,ta as PageDirectoryReconcileResultSchema,h1 as PageDirectoryReconcileStateSchema,I_ as PageDirectoryReconcileStatusSchema,zx as PageDiscoveryCoverageEntrySchema,xM as PageDiscoveryCoverageReasonSchema,Fl as PageDiscoveryCoverageSchema,ad as PageNavigationSchema,sa as PageResourceArtifactSchema,M_ as PageResourceComponentReferenceSchema,U_ as PageResourceComponentSchema,j_ as PageResourceDraftPageSchema,L_ as PageResourceDraftSchema,js as PageResourceFinalRouteSchema,F_ as PageResourcePageSchema,N_ as PageResourcePageSelectionSchema,cc as PageResourceRouteMappingSchema,Vo as PageSchema,XL as PageSeoDeclSchema,$o as PageSlugSchema,P_ as PageTargetKindSchema,Xi as PageTargetProjectionHashSchema,nc as PageTargetSchema,C_ as PageTargetSeoSchema,g1 as PageTargetSetSchema,Sr as PageTemplateBatchManifestSchema,b0 as PageTemplateCleanupRequestSchema,E0 as PageTemplateCleanupResponseSchema,_r as PageTemplateCreateItemSchema,S0 as PageTemplateCreateRequestSchema,y0 as PageTemplateCreateResponseSchema,R0 as PageTemplateErrorCodeSchema,Ze as PageTemplateIdSchema,vn as PageTemplatePagePathSchema,f0 as PageTemplatePromoteRequestSchema,x0 as PageTemplatePromoteResponseSchema,Xd as PageTemplateTaskSchema,La as PaletteInputsSchema,u2 as PersistClarifyAnswersRequestSchema,_2 as PersistClarifyAnswersResponseSchema,m2 as PersistGeneratedSitemapDraftRequestSchema,d2 as PersistGeneratedSitemapDraftResponseSchema,Q2 as PersistPreviewSessionRequestSchema,Z2 as PersistPreviewSessionResponseSchema,h2 as PersistSiteDesignPlanRequestSchema,S2 as PersistSiteDesignPlanResponseSchema,p2 as PersistSiteSitemapDraftResponseSchema,r2 as PersistSiteSitemapRequestSchema,l2 as PersistSiteSitemapResponseSchema,oq as PersistSiteSnapshotRequestSchema,rq as PersistSiteSnapshotResponseSchema,FI as PositioningPrefillSchema,Mo as PositioningSourceSchema,P1 as PrepareDesignerPageBodySchema,YG as PrepareDesignerPageResponseSchema,jN as PrepareSiteBuildInitialGenerationBaseRequestSchema,LN as PrepareSiteBuildInitialGenerationBaseResultSchema,XO as PrepareTemplateUpgradeStateRequestSchema,Nb as PrepareTemplateUpgradeStateResponseSchema,Iq as PrepareVersionPreviewRequestSchema,XI as PrepareVersionPreviewResponseSchema,Qc as ProductSearchAppConfigDraftSchema,Sa as ProductSearchAppSlugSchema,SP as ProductSearchContractFixtureSchema,yh as ProductSearchDraftConfigSchema,Ge as ProductSearchFieldNameSchema,fh as ProductSearchFilterMetaSchema,ba as ProductSearchInteractionRequestSchema,Gs as ProductSearchInteractionResponseSchema,hP as ProductSearchPopularTermsReadSchema,Xc as ProductSearchPopularTermsSchema,Sh as ProductSearchPrepareFailureReasonSchema,fa as ProductSearchPrepareFailureSchema,Ih as ProductSearchRequestSchema,kh as ProductSearchResponseSchema,zn as ProductSearchRouteIdSchema,hh as ProductSearchValueShapeSchema,mq as PromoteSiteSnapshotRequestSchema,VI as PromoteSiteSnapshotResponseSchema,yq as PromoteTemplateUpgradeSnapshotRequestSchema,xq as PromoteTemplateUpgradeSnapshotResponseSchema,IU as QualityCheckOutcomeSchema,sp as QualityRunningStatusSchema,_O as REFUSAL_COPY,A2 as REST_API_ENDPOINTS,Px as ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS,Cx as ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS,sR as ReconcileSitePublishDomainOperationDataSchema,iR as ReconcileSitePublishDomainOperationResponseSchema,uq as RecordSnapshotVersionRequestSchema,_q as RecordSnapshotVersionResponseSchema,rN as RecordTemplateUpgradeEventRequestSchema,cN as RecordTemplateUpgradeEventResponseSchema,JO as RecordTemplateUpgradeFailureRequestSchema,eN as RecordTemplateUpgradeFailureResponseSchema,tN as RecordTemplateUpgradeSuccessRequestSchema,nN as RecordTemplateUpgradeSuccessResponseSchema,l1 as RecoverDesignerPageProjectionRequestSchema,p1 as RecoverDesignerPageProjectionResponseSchema,A_ as RecoverDesignerPageProjectionResultSchema,au as ReferencePagePatternSchema,ys as ReferenceSignalsSchema,pI as RegisterMediaResourceReferenceRequestSchema,dI as RegisterMediaResourceReferenceResponseSchema,sP as RegisterWorkflowTaskCommandRequestSchema,mh as RegisterWorkflowTaskRequestSchema,xv as RegisterWorkspacePageCheckpointRequestSchema,Sq as ReleaseTemplateUpgradeLockRequestSchema,fq as ReleaseTemplateUpgradeLockResponseSchema,oP as ReplaceCrawlWorkflowTaskCommandRequestSchema,ph as ReplaceCrawlWorkflowTaskRequestSchema,aP as ReplaceWorkflowTaskCommandRequestSchema,lh as ReplaceWorkflowTaskRequestSchema,Kj as ResolvedFieldSchema,fL as ResolvedFormFieldSchema,k2 as RestApiMethodSchema,Rq as RestoreSiteSnapshotResponseSchema,HF as ReturnWorkbenchResponseSchema,QL as RootLayoutMetadataSchema,Zp as RouteGenerationCardSchema,oS as RuleEngineInputSchema,lS as RuleEngineScoreRecordSchema,Aa as RuleScoreDimensionKeySchema,mS as RuleScoreDimensionSchema,Nn as SELECTABLE_SITE_LOCALE_CODES,CT as SITEMAP_RESOLVER_MAX_BLOCK_TARGETS,PT as SITEMAP_RESOLVER_MAX_PAGE_TARGETS,ON as SITE_BUILD_CONTEXT_FILE_PATH,NN as SITE_BUILD_CONTEXT_MAX_BYTES,Qg as SITE_BUILD_STATUSES,Bc as SITE_BUILD_STATUS_CODES,Zg as SITE_DEPLOYMENT_STATUSES,Kc as SITE_DEPLOYMENT_STATUS_CODES,Ya as SITE_DESIGN_DENSITY_IDS,$t as SITE_DESIGN_NOTES_END,pn as SITE_DESIGN_NOTES_START,$m as SITE_DESIGN_RADIUS_IDS,gD as SITE_EDIT_DURABLE_HISTORY_CAPABILITY,a_ as SITE_EDIT_MATERIALIZATION_MAX_FILE_CONTENT_BYTES,Hi as SITE_EDIT_MATERIALIZATION_MAX_FILE_COUNT,$i as SITE_EDIT_MATERIALIZATION_MAX_TOTAL_CONTENT_BYTES,Ac as SITE_EDIT_PAGE_COMPOSITION_SCHEMA_VERSION,pw as SITE_EDIT_PAGE_COMPOSITION_V2_CAPABILITY,Qf as SITE_EDIT_RUNTIME_CONTAINER_TAGS,Zf as SITE_EDIT_RUNTIME_TEXT_TAGS,Xf as SITE_EDIT_RUNTIME_VOID_ELEMENT_TAGS,nw as SITE_EDIT_SIGNED_MUTATION_CAPABILITY,du as SITE_EDIT_SOURCE_ALLOWED_APP_FILES,Ir as SITE_EDIT_SOURCE_ALLOWED_DIRS,lu as SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES,pu as SITE_EDIT_SOURCE_ALLOWED_SYSTEM_FILES,Li as SITE_EDIT_SOURCE_DELETE_CAPABILITY,uu as SITE_EDIT_TEXT_SOURCE_EXTENSIONS,il as SITE_EXTRA_REQUIREMENT_MAX_LENGTH,Zv as SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE,Jv as SITE_HAS_SUBSITES_ERROR_CODE,DI as SITE_INITIAL_REVIEW_CARD_KEYS,DC as SITE_LEADING_BODY_TOKEN,OC as SITE_LEADING_HEADING_TOKEN_NAMES,Nu as SITE_LOCALE_CODES,YL as SITE_LOCALIZATION_STRUCTURES,CG as SITE_PLANNING_FROZEN_ERROR_CODE,vG as SITE_PLANNING_LOCKED_ERROR_CODE,jG as SITE_SITEMAP_DRAFT_OPERATION_MISMATCH_ERROR_CODE,NG as SITE_SITEMAP_DRAFT_STALE_ERROR_CODE,DG as SITE_STRUCTURE_CONFIRMATION_REQUIRED_ERROR_CODE,OG as SITE_STRUCTURE_CONFIRMATION_STALE_ERROR_CODE,Fp as SITE_STRUCTURE_INVALID_ERROR_CODE,vC as SITE_WEIGHT_TOKEN_NAMES,Kb as SITE_WORKFLOW_PROGRESS_STATUSES,Hb as SITE_WORKFLOW_PROGRESS_STEP_STATUSES,Jg as SITE_WORKFLOW_STATUSES,zc as SITE_WORKFLOW_STATUS_CODES,w2 as SSE_STREAMS,Bu as STEP5_KEYWORD_CATEGORIES,zu as STEP5_OPTIONAL_STRATEGY_KEYS,Ps as STEP5_REQUIRED_STRATEGY_COUNT,Ln as STEP5_REQUIRED_STRATEGY_KEYS,n_ as STEP5_SSE_EVENT_NAMES,je as STEP5_STRATEGY_COUNT,nn as STEP5_STRATEGY_KEYS,Nr as STEP5_STRATEGY_OPTION_IDS,Qm as STEP6_AI_THEME_IDS,Qa as STEP6_AI_THEME_PRESETS,Zm as STEP6_GENERATED_THEME_ID_PATTERN,ub as SUBSITE_GLOSSARY_ENTRY_MAX_CHARS,_b as SUBSITE_GLOSSARY_MAX_ENTRIES,wb as SUBSITE_MOUNT_PATH_PATTERN,bb as SUBSITE_PALETTE_NOTE_MAX_CHARS,Pb as SUBSITE_RESERVED_MOUNT_SEGMENTS,yA as SUPPORTED_SITE_LOCALES,Jt as SandboxSessionIdSchema,wn as SandboxSessionSchema,Cd as SandboxSessionStatusSchema,qG as SaveBriefDraftRequestSchema,tq as SaveBriefDraftResponseSchema,MR as SaveGa4BindingDataSchema,gF as SaveGa4BindingRequestSchema,hF as SaveGa4BindingResponseSchema,Gj as SaveSiteExtraRequirementRequestSchema,i2 as SaveSiteSitemapDraftRequestSchema,a2 as SaveSiteSitemapDraftResponseSchema,rI as SearchUnsplashMediaQuerySchema,cI as SearchUnsplashMediaResponseSchema,sd as SiteBreadcrumbPlacementSchema,ny as SiteBuildContextFileSchema,ty as SiteBuildContextPayloadSchema,ey as SiteBuildContextProvenanceSchema,Jb as SiteBuildContextProvenanceSourceSchema,ua as SiteBuildStatusSchema,eD as SiteDeletionBlockedDetailsSchema,_a as SiteDeploymentStatusSchema,Ri as SiteDesignContextSchema,qI as SiteDesignDensitySchema,WI as SiteDesignMotionLevelSchema,Cn as SiteEditAdvisorySchema,Xs as SiteEditBoundaryKindSchema,hf as SiteEditCapabilityConstraintSchema,_f as SiteEditCapabilityModeSchema,Ys as SiteEditCapabilityModeViewSchema,iD as SiteEditCapabilityReadRequestSchema,H_ as SiteEditClassNameSourceDiagnosticSchema,gt as SiteEditClassNameSourceRangeSchema,fc as SiteEditClassNameSourceSchema,G1 as SiteEditClassNameSourceStyleContextSchema,Sc as SiteEditClassNameSourceStylesheetSchema,aa as SiteEditClassNameSourceWriteIntentSchema,j1 as SiteEditCommandDiagnosticSchema,K_ as SiteEditCommandErrorSchema,z as SiteEditCompositionContextSchema,he as SiteEditCompositionSelectorSchema,gf as SiteEditConstraintKindSchema,Fg as SiteEditDeletePageSourceOutputSchema,qf as SiteEditDynamicConfidenceSchema,Bf as SiteEditDynamicDataBindingSchema,Om as SiteEditDynamicDataDetailSchema,Nm as SiteEditDynamicDataSummarySchema,Wf as SiteEditDynamicEvidenceSchema,Dm as SiteEditDynamicSourceKindSchema,Ff as SiteEditDynamicSourceTypeSchema,Gf as SiteEditDynamicTargetKindSchema,Fa as SiteEditEffectiveWriteTargetSchema,pD as SiteEditEventSchema,vi as SiteEditExecutionSceneSchema,Js as SiteEditExternalSourceKindSchema,K1 as SiteEditGetClassNameSourceCommandResultSchema,W1 as SiteEditGetClassNameSourceInputSchema,B1 as SiteEditGetClassNameSourceResultSchema,$D as SiteEditGetDocumentInputSchema,VD as SiteEditGetObjectEditContextInputSchema,pA as SiteEditGetSourceFileInputSchema,lA as SiteEditGetSourceTreeInputSchema,q1 as SiteEditGetStyleContextInputSchema,Zs as SiteEditHistoryProvenanceSchema,xf as SiteEditHistoryReadOnlyRecoveryStatusSchema,Sf as SiteEditHistoryRecoveryCodeSchema,ff as SiteEditHistoryRecoveryDiagnosticSchema,SD as SiteEditHistoryResultSchema,hD as SiteEditHistoryStatusModeSchema,Rf as SiteEditHistoryStatusSchema,bf as SiteEditHistoryUnavailableReasonSchema,Ef as SiteEditHistoryUnavailableStatusSchema,yf as SiteEditHistoryWritableStatusSchema,mO as SiteEditInitializeSessionInputSchema,Lg as SiteEditInsertNodeSpecSchema,Ug as SiteEditInsertPageResourceOutputSchema,p_ as SiteEditMaterializationDataRequirementsSchema,l_ as SiteEditMaterializationEntrySchema,m_ as SiteEditMaterializationExportSchema,c_ as SiteEditMaterializationFileSchema,Gr as SiteEditMaterializationPathTemplateSchema,Wt as SiteEditMaterializationSchema,Nc as SiteEditMaterializedComponentNodeSpecSchema,jg as SiteEditMoveNodeTargetSchema,Oc as SiteEditMoveTargetSchema,qn as SiteEditMutationContextSchema,Qs as SiteEditNodeCapabilitySnapshotSchema,XD as SiteEditObjectCapabilitiesSchema,ZD as SiteEditObjectDetailSchema,eO as SiteEditObjectEditContextSchema,tO as SiteEditObjectStyleDetailSchema,JD as SiteEditObjectSummarySchema,Aw as SiteEditOperationCommandResultSchema,jc as SiteEditOperationErrorCodeSchema,Lc as SiteEditOperationErrorSchema,Gg as SiteEditOperationOutputSchema,Mg as SiteEditOperationParamsSchema,la as SiteEditOperationPayloadSchema,ma as SiteEditOperationRequestSchema,Og as SiteEditOperationResultTargetSchema,rn as SiteEditOperationSelectionRefSchema,Uf as SiteEditOperationSummarySchema,wg as SiteEditOperationTargetSchema,Kn as SiteEditOperationTypeSchema,Ht as SiteEditOperationValueSchema,Kf as SiteEditPageCompositionActionScopeSchema,dw as SiteEditPageCompositionAnyVersionSchema,dg as SiteEditPageCompositionAtomicKindSchema,hg as SiteEditPageCompositionBoundaryModeSchema,ig as SiteEditPageCompositionBusinessMemberSchema,ng as SiteEditPageCompositionContainerSchema,Bn as SiteEditPageCompositionDiagnosticSchema,Ms as SiteEditPageCompositionErrorCodeSchema,Ic as SiteEditPageCompositionPlacementTargetSchema,ag as SiteEditPageCompositionPlacementUnitSchema,lg as SiteEditPageCompositionRuntimeRefSchema,mg as SiteEditPageCompositionSchema,pg as SiteEditPageCompositionSourceMemberKindSchema,sg as SiteEditPageCompositionSourceMemberSchema,wc as SiteEditPageCompositionSourceRangeSchema,rg as SiteEditPageCompositionSupportedSchema,cg as SiteEditPageCompositionUnsupportedSchema,gg as SiteEditPageCompositionV2BusinessMemberSchema,ug as SiteEditPageCompositionV2ContainerSchema,fg as SiteEditPageCompositionV2PlacementRelationSchema,yg as SiteEditPageCompositionV2PlacementSchema,Sg as SiteEditPageCompositionV2PlacementUnitSchema,Ig as SiteEditPageCompositionV2Schema,_g as SiteEditPageCompositionV2SourceMemberSchema,Eg as SiteEditPageCompositionV2SupportedSchema,Rg as SiteEditPageCompositionV2UnsupportedSchema,bg as SiteEditPageCompositionV2WriteModeSchema,xg as SiteEditPageCompositionVisualAnchorSchema,og as SiteEditPagePlacementOptionSchema,Rc as SiteEditPagePlacementSchema,kc as SiteEditPageUnitResultTargetSchema,Tc as SiteEditPageUnitTargetSchema,vf as SiteEditPatchPlanPatchSchema,AD as SiteEditPatchPlanSchema,Ga as SiteEditPropertiesSchema,ra as SiteEditPropertyChangeSchema,wf as SiteEditPropertyCreationSchema,kf as SiteEditPropertyItemSchema,If as SiteEditPropertyResolutionSchema,Tf as SiteEditPropertySourceSchema,Af as SiteEditPropertySpreadSchema,Zn as SiteEditProvenanceChainSchema,$f as SiteEditProvenanceHopSchema,YD as SiteEditRenderDocumentSchema,Qn as SiteEditRenderEntryRefSchema,zf as SiteEditRenderEntrySchema,vm as SiteEditRenderPageCompositionSchema,Lf as SiteEditRenderPageCompositionSupportedSchema,Mf as SiteEditRenderPageCompositionUnsupportedSchema,jf as SiteEditRenderPagePlacementSchema,sw as SiteEditRequiredMutationContextEnvelopeSchema,uA as SiteEditResolveSourceLocationInputSchema,Lm as SiteEditSemanticSourceSchema,yc as SiteEditSetPropsParamsSchema,kw as SiteEditSignedOperationRequestSchema,Tr as SiteEditSourceDeleteCapabilitySchema,gu as SiteEditSourceDirectoryPathSchema,yu as SiteEditSourceFileBinaryPreviewUnavailableReasonSchema,xu as SiteEditSourceFileBinaryResponseSchema,cA as SiteEditSourceFileKindSchema,hu as SiteEditSourceFileListItemSchema,dA as SiteEditSourceFileResponseSchema,bu as SiteEditSourceFileTextResponseSchema,ca as SiteEditSourceIdentitySchema,Eu as SiteEditSourceLocationRangeSchema,_A as SiteEditSourceLocationSchema,Yf as SiteEditSourceLocatorRangeSchema,Ba as SiteEditSourceLocatorSchema,Ie as SiteEditSourcePathSchema,Ng as SiteEditSourceSiblingMoveTargetSchema,kr as SiteEditSourceTreeNodeSchema,mA as SiteEditSourceTreeResponseSchema,Su as SiteEditSourceTreeTruncationReasonSchema,fu as SiteEditSourceTreeTruncationSchema,Dc as SiteEditStyleBreakpointSchema,xc as SiteEditStyleDraftPropertySchema,QD as SiteEditStyleModelSchema,Cc as SiteEditStylePropertySchema,Mm as SiteEditStyleSourceSchema,vc as SiteEditStyleStateModeSchema,Wa as SiteEditTextSegmentSchema,jm as SiteEditTextSourceSchema,Hf as SiteEditWriteTargetSchema,qj as SiteExtraRequirementResponseSchema,Ey as SiteExtraRequirementSchema,Av as SiteGenerationLedgerResponseSchema,k as SiteIdSchema,Up as SiteInitialReviewCardKeySchema,OI as SiteInitialReviewCardSchema,XF as SiteInitialReviewCardsResponseSchema,LI as SiteInitialReviewCardsSchema,Mp as SiteInitialReviewCheckSchema,jI as SiteInitialReviewDetailSchema,CI as SiteInitialReviewErrorSchema,MI as SiteInitialReviewEventCursorSchema,ZF as SiteInitialReviewEventSchema,NI as SiteInitialReviewMetricSchema,PI as SiteInitialReviewPhaseSchema,YF as SiteInitialReviewStatusResponseSchema,vI as SiteInitialReviewStatusSchema,JF as SiteInitialReviewStreamErrorSchema,UI as SiteInitialReviewSummarySchema,Qb as SiteLauncherPermissionSchema,Te as SiteLocaleSchema,Bq as SiteMediaIntentSchema,Kk as SiteOperationLockIdSchema,qb as SitePreviewActivateErrorCodeSchema,Bb as SitePreviewActivateFailedSchema,Wb as SitePreviewActivateReadySchema,gN as SitePreviewActivateResponseSchema,NU as SitePublishDomainCheckDataSchema,OU as SitePublishDomainCheckRequestSchema,jU as SitePublishDomainCheckResponseSchema,LU as SitePublishDomainOperationDataSchema,MU as SitePublishDomainOperationResponseSchema,UU as SitePublishDomainReconcileOperationResponseSchema,FU as SitePublishDomainRemediationConfirmRequestSchema,GU as SitePublishDomainRemediationConfirmResponseSchema,yi as SitePublishQualityTaskStatusSchema,dU as SitePublishRepairInputItemSchema,KE as SitePublishRepairResultItemSchema,ip as SitePublishRepairResultSchema,uU as SitePublishRepairTaskSnapshotSchema,np as SitePublishRepairTaskStatusSchema,SU as SitePublishWorkflowActiveResponseSchema,_s as SitePublishWorkflowIdSchema,HE as SitePublishWorkflowMutationDataSchema,fU as SitePublishWorkflowMutationResponseSchema,$E as SitePublishWorkflowPublishDataSchema,bU as SitePublishWorkflowPublishResponseSchema,VE as SitePublishWorkflowQualityDataSchema,yU as SitePublishWorkflowQualityResponseSchema,jt as SitePublishWorkflowRecordSchema,hU as SitePublishWorkflowRevisionRequestSchema,ME as SitePublishWorkflowStatusSchema,UE as SitePublishWorkflowStepSchema,Ut as SiteRecordSchema,Hk as SiteTemplateUpgradeStateIdSchema,N2 as SiteThreadListQuerySchema,j2 as SiteThreadListResponseSchema,U2 as SiteThreadResponseSchema,sr as SiteVersionIdSchema,YI as SiteVersionListItemSchema,wi as SiteVersionRecordSchema,ot as SiteWorkflowIdSchema,Yb as SiteWorkflowProgressDataSchema,xN as SiteWorkflowProgressResponseSchema,zb as SiteWorkflowProgressStatusSchema,Vb as SiteWorkflowProgressStepSchema,$b as SiteWorkflowProgressStepStatusSchema,ch as SiteWorkflowRecordSchema,Xw as SiteWorkflowSnapshotResponseSchema,ha as SiteWorkflowSnapshotSchema,eh as SiteWorkflowStatusSchema,ar as SiteWorkflowTaskRefIdSchema,Qw as SiteWorkflowTaskRefResponseSchema,Vc as SiteWorkflowTaskRefSchema,Zq as SitemapAddBlockInputSchema,Yo as SitemapAnswerSchema,Xq as SitemapChangeBlockVariantInputSchema,OT as SitemapDeleteBlockInputSchema,yT as SitemapDraftBlockSchema,xT as SitemapDraftPageSchema,_d as SitemapDraftRecordSchema,bn as SitemapDraftSchema,DT as SitemapEditActorSchema,LT as SitemapEditErrorCodeSchema,UT as SitemapEditFailureSchema,jT as SitemapEditOperationSchema,e2 as SitemapEditResultSchema,MT as SitemapEditSuccessSchema,n2 as SitemapGenerationInputSchema,BT as SitemapGenerationOutcomeSchema,KT as SitemapGenerationReasonSchema,cd as SitemapGenerationStageSchema,we as SitemapIdSchema,FT as SitemapIntentPageSchema,Vq as SitemapModelOutputSchema,RT as SitemapModelPageSchema,Yq as SitemapMoveBlockInputSchema,fT as SitemapNavigationHrefSchema,We as SitemapNodeIdSchema,ud as SitemapRecordSchema,Hq as SitemapResolverRequestSchema,$q as SitemapResolverResponseSchema,vT as SitemapResolverTargetsSchema,rd as SitemapRunInputSchema,In as SitemapSchema,TT as SitemapSourceProvenanceSchema,s2 as SitemapStreamEventSchema,bM as SitemapTaskCreateRequestSchema,IM as SitemapTaskCreateResponseSchema,Jx as SitemapTaskFailureErrorCodeSchema,TM as SitemapTaskResponseSchema,NT as SitemapUpdateBlockInstructionInputSchema,Qq as SitemapUpdateBlockPropsInputSchema,sT as SitemapUserChoiceSchema,Rn as SkillSelectionSchema,aT as SkillSelectionSourceSchema,Ed as SnapshotContentHashSchema,$d as SnapshotEditChangesSchema,Hd as SnapshotEditPageChangeSchema,zd as SnapshotEditSectionChangeSchema,Oe as SnapshotFilePathSchema,I as SnapshotIdSchema,It as SnapshotRecordSchema,Xp as SnapshotStatusSchema,wv as StartFillInRequestSchema,nq as StartFillInResponseSchema,IR as StartGa4AuthDataSchema,rF as StartGa4AuthRequestSchema,cF as StartGa4AuthResponseSchema,Ao as StartGscAuthDataSchema,op as StartGscAuthRequestSchema,rp as StartGscAuthResponseSchema,rP as StartSiteBuildRequestSchema,MN as StartSiteBuildResponseSchema,sy as StartSiteBuildResultSchema,_U as StartSitePublishWorkflowRequestSchema,P2 as StartWorkspaceRunRequestSchema,C2 as StartWorkspaceRunResponseSchema,nm as Step2AiCrawlabilityAssessmentSchema,Gh as Step2FinalResultDataSourceSchema,Ws as Step2FinalResultRequestSchema,YP as Step2FinalResultResponseSchema,VP as Step2FinalResultSaveResponseSchema,Fh as Step2FinalResultSaveResultSchema,Ra as Step2FinalResultTypeSchema,Wh as Step2FinalResultViewSchema,tm as Step2FinalScanCardKeySchema,Ia as Step2FinalScanCardSchema,Uh as Step2FinalScanResultSchema,Jn as Step2KnowledgeOpaqueIdSchema,BN as Step2KnowledgeScopeSchema,wt as Step2PageRoleSchema,ZP as Step2PageSelectionRequestSchema,JP as Step2PageSelectionResponseSchema,jh as Step2SiteInitializationCrawlerErrorCodeSchema,Nh as Step2SiteInitializationStatusSchema,$P as Step2SiteInitializationTaskResponseSchema,Lh as Step2SiteInitializationTaskSchema,Ta as Step3AgentAnalysisSchema,Yh as Step3AnalysisFindingSchema,oC as Step3AnalysisJobResponseSchema,om as Step3AnalysisJobSchema,im as Step3AnalysisJobStatusSchema,rC as Step3AnalysisLatestResponseSchema,sm as Step3AnalysisProgressSchema,Zh as Step3AnalysisResultSchema,aC as Step3AnalysisScheduleResponseSchema,Vh as Step3AnalysisScheduleSchema,cC as Step3AnalysisSseFrameSchema,sC as Step3AnalysisStartRequestSchema,am as Step3AnalysisSummarySchema,$h as Step3AnalystSchema,iC as Step3AnalystsResponseSchema,dC as Step4DiagnosisResponseSchema,Cs as Step5ActiveStrategyKeySchema,FA as Step5CommitStrategyRequestSchema,GA as Step5CommitStrategyResponseSchema,e_ as Step5CommittedVersionSchema,Mn as Step5DecisionSelectionIdSchema,Yu as Step5EvidenceReferenceSchema,Xu as Step5GenerationStatusSchema,Zu as Step5JobStatusSchema,ks as Step5KeywordCategorySchema,Ku as Step5KeywordEntryEditSchema,jn as Step5KeywordEntrySchema,qi as Step5KeywordLibrarySchema,wA as Step5KeywordSearchBodySchema,As as Step5KeywordSelectionSchema,Os as Step5MarketCountrySchema,Ds as Step5MarketTypeSchema,Or as Step5OptionPresentationSchema,Bi as Step5OutputLocaleSchema,Hu as Step5PromotedBusinessSchema,Ns as Step5PromotedBusinessesSchema,LA as Step5RegenerateItemRequestSchema,MA as Step5SaveDecisionRequestSchema,UA as Step5SaveDecisionResponseSchema,GT as Step5SitemapDecisionSchema,WT as Step5SitemapRunInputSchema,qT as Step5SitemapSourceSchema,t2 as Step5SitemapStartRequestSchema,NA as Step5StartStrategyRequestSchema,jA as Step5StartStrategyResponseSchema,Qu as Step5StrategyDecisionInputSchema,zi as Step5StrategyDecisionSchema,Ki as Step5StrategyItemSchema,Mr as Step5StrategyJobSchema,vs as Step5StrategyKeySchema,jr as Step5StrategyOptionIdSchema,$u as Step5StrategyOptionSchema,Lr as Step5StrategyPlanSchema,t_ as Step5StrategySnapshotDataSchema,WA as Step5StrategySseFrameSchema,Ju as Step5StrategyVersionSnapshotSchema,Vu as Step5StructureDetailSchema,_y as Step6AiThemeCandidateSchema,ii as Step6ColorSeedsSchema,vj as Step6DesignAgentRecommendationsResponseSchema,Ij as Step6DesignRecommendationGenerationInputSchema,eo as Step6DesignRecommendationModelOutputSchema,gy as Step6DesignRecommendationSchema,yj as Step6DesignRecommendationsRequestSchema,xj as Step6DesignRecommendationsResponseSchema,sl as Step6DesignSelectionSchema,nl as Step6GeneratedThemeCardSchema,yy as Step6GptDesignRecommendationModelOutputSchema,Tv as StopWorkspaceGenerationRequestSchema,kv as StopWorkspaceGenerationResponseSchema,DO as SubsiteCopyEstimateRequestSchema,OO as SubsiteCopyEstimateResponseSchema,Ib as SubsiteDiffEstimateShape,IO as SubsiteGlossariesSchema,hb as SubsiteGlossaryEntrySchema,ei as SubsiteHexColorSchema,HO as SubsiteMountPathSchema,Rb as SubsitePageEstimateSchema,kO as SubsitePaletteLocalizationSchema,Sb as SubsitePaletteModeSchema,fb as SubsitePaletteSeedsSchema,TO as SubsiteSiteInfoSchema,LO as SubsiteSyncDiffComputeRequestSchema,MO as SubsiteSyncDiffComputeResponseSchema,kb as SubsiteSyncDiffErrorCodeSchema,UO as SubsiteSyncDiffErrorResponseSchema,WO as SubsiteVisibleTextExportRequestSchema,BO as SubsiteVisibleTextExportResponseSchema,Xg as TASK_EXECUTION_STATUSES,Hc as TASK_EXECUTION_STATUS_CODES,bq as TEMPLATE_UPGRADE_LOCK_LOST_ERROR_CODE,Za as THEME_PRESETS,Xm as THEME_PRESET_IDS,Wc as TaskExecutionStatusSchema,Ub as TemplateUpgradeCasOutcomeSchema,qm as TemplateUpgradeErrorCodeSchema,Fb as TemplateUpgradeOutcomeCountsSchema,Lb as TemplateUpgradeOutcomeSchema,Gb as TemplateUpgradeSnapshotDeletionCandidateSchema,gn as TemplateUpgradeStateSchema,Db as TemplateUpgradeStatusSchema,Mb as TemplateUpgradeValidationStageSchema,et as TemplateVersionSchema,gq as TryAcquireTemplateUpgradeLockRequestSchema,hq as TryAcquireTemplateUpgradeLockResponseSchema,MS as TypeInputsSchema,cb as USER_STOPPED_RUN_ERROR_CODES,vp as UnsplashDownloadLocationSchema,Cp as UnsplashMediaAssetSchema,GG as UpdateBriefRequestSchema,eq as UpdateBriefResponseSchema,g2 as UpdateClarifyArchetypeRequestSchema,b1 as UpdateCmsSeoSyncStateRequestSchema,cq as UpdateCurrentSnapshotManifestRequestSchema,S1 as UpdatePageDirectoryReconcileStateRequestSchema,gU as UpdateSitePublishWorkflowStepRequestSchema,FG as UpdateSiteRequestSchema,M2 as UpdateSiteThreadRequestSchema,Jw as UpdateSiteWorkflowWebsiteRequestSchema,Ej as UpdateStep6DesignSelectionRequestSchema,Rj as UpdateStep6DesignSelectionResponseSchema,iP as UpdateWorkflowTaskStatusRequestSchema,iI as UploadMediaLibraryAssetResponseSchema,nU as UpstreamPromptTemplateCatalogDataSchema,tU as UpstreamPromptTemplateConsumeDataSchema,Wx as UrlListCrawlerTaskCreateRequestSchema,$k as UsageRecordIdSchema,mI as UseUnsplashMediaRequestSchema,lI as UseUnsplashMediaResponseSchema,Lk as UserIdSchema,mR as VCP_GSC_STATES,ko as VcpGscStateSchema,GE as VcpQualityRemediationItemSchema,tp as VcpQualityResultSchema,Fo as VisualHintsSchema,nT as VisualThemeSchema,PS as WEIGHT_STYLE_IDS,_m as WEIGHT_STYLE_PRESETS,Yw as WORKFLOW_DEFINITIONS_V1,ga as WORKFLOW_DEFINITION_REGISTRY,$g as WORKFLOW_FLOW_TYPES,th as WORKFLOW_MENU_STATES,Vg as WORKFLOW_NODE_CODES,Yg as WORKFLOW_TASK_TYPES,kP as WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE,OP as WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_ERROR_CODE,vP as WORKSPACE_ATTACHMENT_CAPTURE_BUSY_ERROR_CODE,CP as WORKSPACE_ATTACHMENT_CAPTURE_FAILED_ERROR_CODE,DP as WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT_ERROR_CODE,NP as WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE_ERROR_CODE,TP as WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE,Ah as WORKSPACE_ATTACHMENT_MEDIA_TYPES,EP as WORKSPACE_ATTACHMENT_TARGET_BASE64_BYTES,IP as WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE,xP as WORKSPACE_ATTACHMENT_UNBOUND_TTL_MS,RP as WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE,PP as WORKSPACE_ATTACHMENT_URL_REJECTED_ERROR_CODE,pv as WORKSPACE_CHECK_INCOMPLETE_ERROR_CODE,pE as WORKSPACE_FILE_MUTATION_TOOL_NAMES,uv as WORKSPACE_FILL_IN_INTERRUPTED_ERROR_CODE,dv as WORKSPACE_GENERATION_STOPPED_ERROR_CODE,mv as WORKSPACE_MAX_PAGE_ATTEMPTS,cv as WORKSPACE_MAX_RESUME_COUNT,rv as WORKSPACE_RUN_HEARTBEAT_INTERVAL_MS,ov as WORKSPACE_RUN_LEASE_MS,_v as WORKSPACE_RUN_LEASE_SUPERSEDED_ERROR_CODE,gv as WORKSPACE_RUN_NOT_ACTIVE_ERROR_CODE,lv as WORKSPACE_RUN_RESUME_EXHAUSTED_ERROR_CODE,wP as WORKSPACE_URL_CAPTURE_WINDOW_MS,B2 as WORKSPACE_WEBSOCKET_CONTRACT,Ke as WeightStyleIdSchema,Gc as WorkflowClientCapabilitiesSchema,$c as WorkflowDefinitionVersionSchema,cn as WorkflowFlowTypeSchema,rh as WorkflowMenuItemSchema,nh as WorkflowMenuStateSchema,At as WorkflowNodeCodeSchema,qc as WorkflowTaskTypeSchema,LP as WorkspaceAttachmentFromUrlRequestSchema,xa as WorkspaceAttachmentMediaTypeSchema,jP as WorkspaceAttachmentSchema,Sk as WorkspaceClientMessageSchema,_I as WorkspaceDesignApplyRequestSchema,gI as WorkspaceDesignApplyResponseSchema,hI as WorkspaceDesignCurrentResponseSchema,Qo as WorkspaceDiagnosticSchema,kk as WorkspaceDirectEditFileSchema,Tk as WorkspaceDirectEditPathSchema,kd as WorkspaceDirectEditPostActionSchema,H2 as WorkspaceDirectEditRequestSchema,V2 as WorkspaceDirectEditResponseSchema,Zo as WorkspaceExecutionDiagnosticsSchema,f2 as WorkspaceExecutionPlanSchema,Rr as WorkspaceGenerationLedgerEventSchema,On as WorkspaceGenerationLedgerSchema,Ik as WorkspaceMediaRequestSchema,Jd as WorkspaceOmissionKindSchema,eu as WorkspaceOmissionReasonSchema,Er as WorkspaceOmissionSchema,Im as WorkspacePageCheckpointSchema,nu as WorkspacePageOutcomeSchema,tu as WorkspacePageResultSchema,tr as WorkspacePlanDependencySchema,Sd as WorkspacePlanSummarySchema,ek as WorkspacePlanTaskKindSchema,er as WorkspacePlanTaskSchema,Wg as WorkspaceResourceKindSchema,Kg as WorkspaceResourceNavigationSelectionSchema,Fc as WorkspaceResourceOperationClientMessageSchema,bd as WorkspaceResourceOperationCompletionSchema,Bg as WorkspaceResourceOperationSummarySchema,zg as WorkspaceResourceOperationTransientInputSchema,Us as WorkspaceResourcePageCopySchema,Rv as WorkspaceRunControlInputResponseSchema,bv as WorkspaceRunHeartbeatRequestSchema,yv as WorkspaceRunHeartbeatResponseSchema,Pi as WorkspaceRunKindSchema,JS as WorkspaceRunResumePrincipalSchema,hk as WorkspaceSelectedComponentSchema,bk as WorkspaceServerMessageSchema,Jq as WorkspaceSitemapEditRequestSchema,gk as WorkspaceSocketDescriptorSchema,Dk as WorkspaceSourceFileBinaryResponseSchema,Ck as WorkspaceSourceFileKindSchema,wd as WorkspaceSourceFileListItemSchema,Y2 as WorkspaceSourceFilePathQuerySchema,X2 as WorkspaceSourceFileResponseSchema,vk as WorkspaceSourceFileTextResponseSchema,Ad as WorkspaceSourcePathSchema,VT as WorkspaceSuggestionSchema,gd as WorkspaceSuggestionsSchema,YT as WorkspaceSuggestionsSourceSchema,fd as WorkspaceTaskCountsSchema,W2 as WorkspaceWebSocketMessageSchema,q2 as WorkspaceWebSocketMessageTypeSchema,Jo as WorkspaceWorkerGroupSchema,Xo as WorkspaceWorkerPhaseSchema,b2 as WorkspaceWorkerResultSchema,Qt as WorkspaceWorkerStatusSchema,nL as applicationTemplateCatalogDataSchema,tL as applicationTemplateConsumeDataSchema,eL as applicationTemplateV1Schema,yC as assertDeploymentTransition,yF as assertFillInTargetsOmitted,dP as assertSiteBuildStatusTransition,pP as assertTaskExecutionStatusTransition,Oa as availableFontWeights,df as breadcrumbClassName,uM as buildCmsIdentityHeaders,fF as buildE2bBrowserPreviewUrl,RU as buildFinalSitePublishQualityResult,Tj as buildStep6FallbackThemeCards,kN as canEnterLauncher,AN as canPublishSite,bo as canonicalizeFormDesignJson,sU as canonicalizeLauncherPromptTemplateOperation,gc as canonicalizePageSlug,ZC as checkGlobalsCssEdit,oa as classifySiteEditPropertyName,o1 as cmsPagePreviewUrlPath,zA as compareTemplateVersions,PD as composeSiteEditRepeatInstanceKey,HL as computeFormDesignOperationFingerprint,ji as computeSiteEditCompositionKey,tg as computeSiteEditSourceIdentityKey,us as containsSensitiveData,j0 as countLedgerAccessiblePages,L0 as countLedgerProcessedPages,$R as countSitemapStructure,z_ as createSiteEditCommandFailureSchema,hc as createSiteEditCommandResultSchema,ia as createSiteEditCommandSuccessSchema,o2 as createSiteSitemapDraftCreationKey,BP as createSitemapResolverAnswerSheetSchema,Aj as defaultStep6Selection,dR as deriveVcpGscState,uR as doesGscPropertyMatchDomain,QR as estimateNavLabelWidth,uh as findWorkflowDefinition,dh as findWorkflowDefinitionInRegistry,Ca as fontStack,kx as formDesignOperationFingerprintInput,FS as formatSiteDesignNotes,Vv as generateDetailBreadcrumb,xC as getDeploymentHappyPathTransitions,fC as getDeploymentTransitionPredecessors,SC as getDeploymentTransitionTargets,um as getFontPairing,Ym as getMotionPreset,bi as getQualityCheckOutcome,Jm as getSiteDesignThemeRadius,Ui as getSiteEditSourceDeleteProtectionReason,xU as getSitePublishRepairItems,TU as getSitePublishSafetyAssessment,mj as getThemePreset,_h as getWorkflowDefinition,mP as getWorkflowNodeIndex,k0 as hasAnyBusinessFact,Xn as hasDesignTokenBlock,wO as hasLockedSeeds,zL as hashAffectedFormDesignFiles,KL as hashCmsFormSchemaProjection,di as hashFormDesignJson,BL as hashFormSpec,WR as homeLabelForLocale,HM as isCanonicalFileMutationToolName,uc as isCanonicalPageSlug,Zb as isCmsMainProductsWithinLimit,SI as isCmsNavigationHref,a1 as isCmsPageSelectable,Hr as isCmsTemplateUrlPath,H0 as isConsentGranted,_S as isDeploymentActiveStatus,bC as isDeploymentTerminalStatus,pb as isExactEditEngineVersion,i0 as isExternalSiteEditInfrastructureReason,dO as isFontLicenseBuildErrorCode,kL as isFormSpecLocalizableFieldPath,qA as isKnownStep5SseEventName,Hv as isMigrationProductsPresetBlockLabel,zv as isMigrationProductsPresetPageTitle,dE as isModelFileMutationToolName,vu as isNextPageCodeErrorCode,RA as isNonLatinSiteLocale,hs as isPageTemplateCandidateEntryPath,aM as isPlatformMaterializedFile,vb as isReservedSubsiteMountSegment,Iu as isSiteEditDesignDocumentPath,r_ as isSiteEditMaterializationPathTemplate,sb as isSiteEditRuntimeContainerTag,ib as isSiteEditRuntimeTextTag,sO as isSiteEditRuntimeVoidElementTag,gA as isSiteEditSourceDeleteProtectedPath,Ru as isSiteEditSourceDirectoryPath,Ar as isSiteEditSourcePath,Mi as isSiteEditTextSourcePath,XE as isSitePublishQualityItemIssue,EU as isSitePublishRepairResultSuccessful,eM as isSiteStructureKnownFieldPath,JL as isSiteStructureLocalizableFieldPath,OA as isStep5RequiredStrategyKey,Ei as isTopLevelPage,uO as isUserStoppedRunErrorCode,lP as isWorkflowTaskTypeForNode,zM as isWorkspaceFileMutationToolName,hp as listChildPages,Of as makeSiteEditRepeatInstanceKey,KR as markAllPagesInHeader,NL as mergeCmsFormDisplay,Bv as migrationProductsCopyForLocale,Kv as migrationProductsKnownCopies,BR as moreLabelForLocale,ZR as navLabelCollisionKey,lL as normalizeCmsApplicationSlug,Gx as normalizeCmsPublicApiBase,xl as normalizeFormOptionLabelIdentity,ls as normalizeGscDomain,hr as normalizePageTemplatePagePath,xi as normalizeStructureTitle,HR as orderNavigationLinksByStructure,Sp as orderSitemapPagesForDisplay,B_ as pageSlugToRouteFilePath,r1 as parseCmsPageDirectory,jv as parseComponentI18nResourcesJson,UR as parseE2bPreviewProxyDomain,db as parseExactEditEngineVersion,sA as parseSiteEditCompositionKey,Nf as parseSiteEditRepeatInstanceKey,ow as parseSiteEditSourceIdentityKey,Ea as parseWorkspaceAttachmentImagePath,OL as projectFormSpecToCmsDisplay,DL as projectFormSpecToCmsSchema,XS as readColorScheme,zs as readDesignTokens,VC as readGlobalsDesignValues,Sm as readSiteDesignNotes,UP as readWorkspaceAttachmentReferences,FR as reconcileSitemapNavigation,pM as resolveCmsPublicRuntimeBinding,yS as resolveFont,mn as resolveFontDisplayName,vL as resolveFormTemplateText,cP as resolvePublishedWorkflowDefinition,D0 as resolveRedisConnectionConfig,yO as resolveRequestedEditEngineVersion,Dr as resolveSelectableSiteLocale,iO as resolveSiteEditRuntimeOperationSummary,EA as resolveSiteLocaleFromIso6393,xA as resolveSiteTextDirection,Sy as resolveStep6RadiusId,fy as resolveStep6WeightStyle,xO as resolveSystemCurrentEditEngineVersion,uL as resolveTemplateFormScene,LC as resolveTryOnFontWeights,gh as selectPublishedWorkflowDefinition,J0 as selectReferenceVisualImage,qw as siteBuildStatusFromCode,zw as siteBuildStatusToCode,Ww as siteDeploymentStatusFromCode,Hw as siteDeploymentStatusToCode,AS as siteFontVariables,jS as siteLeadingBody,jC as siteLeadingHeadingVariables,NC as siteWeightVariables,Bw as siteWorkflowStatusFromCode,$w as siteWorkflowStatusToCode,gb as splitSubsiteGlossaryEntry,by as step6GptVisualIdentity,GC as stripSiteDesignNotes,CD as stripSiteEditRepeatInstanceKeys,Kw as taskExecutionStatusFromCode,Vw as taskExecutionStatusToCode,kj as toStep6GenerationVisualHints,_c as tryCanonicalizeAsciiPageSlug,qC as upsertSiteDesignNotes,Pm as validateComponentI18nResources,AL as validateFormSpecIdentityTransition,VR as validateSitemapStructure,Tb as validateSubsiteDiffEstimates,Ow as validateWorkspaceResourcePageCopy,MP as workspaceAttachmentImagePath,$C as writeColorScheme,HC as writeDesignTokens};
|
|
68
|
+
`}import{z as un}from"zod";var Zv="SITE_HAS_ACTIVE_SUBSITES",Jv="SITE_HAS_SUBSITES",uf=un.object({site_id:k,name:un.string().min(1),mount_path:un.string().min(1),archived_at:un.string().nullable()}),eD=un.object({subsites:un.array(uf)});import{z as Ce}from"zod";var iD=Ce.object({key:Ce.string().min(1),composition:he}).strict(),Xs=Ce.enum(["component-boundary","repeat-region","conditional-region","fragment-region","opaque-region"]),_f=Ce.enum(["direct","proxy","upstream","readonly","unsupported"]),gf=Ce.enum(["component-boundary","repeat-region","conditional-region","opaque-region","void-element","read-only","cross-file-required","import-required"]),Ys=Ce.object({mode:_f,reasonCode:Ce.string().min(1).optional()}),hf=Ce.object({kind:gf,message:Ce.string().min(1)}),Qs=Ce.object({composition:z,key:Ce.string().min(1),canUpdateText:Ce.boolean(),canInsertChild:Ce.boolean(),canMove:Ce.boolean(),canRemove:Ce.boolean(),editModes:Ce.object({updateText:Ys.optional(),insertChild:Ys.optional(),move:Ys.optional(),remove:Ys.optional()}).optional(),constraints:Ce.array(hf)}).strict();import{z as Q}from"zod";var pD=Q.discriminatedUnion("type",[Q.object({type:Q.literal("site-edit.document.changed"),siteId:k,snapshotId:I,composition:z,version:Q.number().int().nonnegative(),at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.operation.planned"),siteId:k,operationId:Q.string().min(1),baseSnapshotId:I,composition:z,changedFiles:Q.array(Q.string().min(1)),at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.operation.completed"),siteId:k,composition:z,result:la,at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.operation.failed"),siteId:k,composition:z,requestId:Q.string().min(1),error:Lc,at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.capability.changed"),siteId:k,composition:z,keys:Q.array(Q.string().min(1)),at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.graph.invalidated"),siteId:k,composition:z,at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.graph.ready"),siteId:k,composition:z,version:Q.number().int().nonnegative(),at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.graph.error"),siteId:k,composition:z,message:Q.string().min(1),at:Q.string().min(1)}).strict(),Q.object({type:Q.literal("site-edit.snapshot.changed"),siteId:k,composition:z,snapshotId:I,previousSnapshotId:Q.string().min(1).nullable(),at:Q.string().min(1)}).strict()]);import{z as me}from"zod";var gD="durable-history-v1",Zs=me.object({initiatingComposition:z.optional(),affectedCompositions:me.array(z)}).strict(),hD=me.enum(["writable","read-only-recovery","unavailable"]),Sf=me.enum(["INDEX_CORRUPT","ENTRY_MISSING","BLOB_MISSING","FILESYSTEM_UNAVAILABLE","ROLLBACK_INCOMPLETE","UNKNOWN"]),ff=me.object({code:Sf,message:me.string().min(1),occurredAt:me.iso.datetime().optional()}).strict(),bf=me.enum(["NOT_INITIALIZED","FILESYSTEM_UNAVAILABLE","UNSUPPORTED_RUNTIME"]),Cm={revision:me.number().int().nonnegative(),undoDepth:me.number().int().nonnegative(),redoDepth:me.number().int().nonnegative()},yf=me.object({mode:me.literal("writable"),composition:z,...Cm,canUndo:me.boolean(),canRedo:me.boolean(),provenance:Zs.optional()}).strict().superRefine((e,n)=>{e.canUndo!==e.undoDepth>0&&n.addIssue({code:"custom",path:["canUndo"],message:"canUndo must reflect undoDepth."}),e.canRedo!==e.redoDepth>0&&n.addIssue({code:"custom",path:["canRedo"],message:"canRedo must reflect redoDepth."})}),xf=me.object({mode:me.literal("read-only-recovery"),composition:z,...Cm,canUndo:me.literal(!1),canRedo:me.literal(!1),recoveryDiagnostic:ff,provenance:Zs.optional()}).strict(),Ef=me.object({mode:me.literal("unavailable"),composition:z,revision:me.literal(0),undoDepth:me.literal(0),redoDepth:me.literal(0),canUndo:me.literal(!1),canRedo:me.literal(!1),reason:bf,provenance:Zs.optional()}).strict(),Rf=me.discriminatedUnion("mode",[yf,xf,Ef]),SD=me.object({composition:z,status:Rf,provenance:Zs}).strict();import{z as Y}from"zod";var Js=Y.enum(["api-field","cms-field","i18n-message","config-entry"]),Fa=Y.object({kind:Y.enum(["jsx-node","value-path","route-export","external-entry"]),file:Y.string().min(1).optional(),isProxy:Y.boolean(),displayPath:Y.string().min(1).optional(),sourceType:Js.optional(),sourceId:Y.string().min(1).optional()}),If=Y.discriminatedUnion("status",[Y.object({status:Y.literal("resolved"),value:Ht}).strict(),Y.object({status:Y.literal("undefined")}).strict(),Y.object({status:Y.literal("unresolved")}).strict()]),Tf=Y.object({kind:Y.enum(["literal","boolean-shorthand","expression","binding","repeat-template"]),raw:Y.string().optional()}).strict(),kf=Y.object({name:Y.string().min(1),source:Tf,resolution:If,editMode:Y.enum(["direct","proxy","upstream","readonly","unsupported"]),sourceScope:Y.enum(["node","repeat-item","repeat-template"]),allowedWriteScopes:Y.array(Y.enum(["selection","template"])),effectiveWriteTarget:Fa.optional(),diagnostics:Y.array(Y.object({code:Y.string().min(1),message:Y.string().min(1)}).strict())}).strict(),Af=Y.object({raw:Y.string().min(1),sourceRange:gt,order:Y.number().int().nonnegative(),diagnostics:Y.array(Y.object({code:Y.string().min(1),message:Y.string().min(1)}).strict())}).strict(),wf=Y.object({selection:Y.enum(["direct","materialize","unsupported"]),template:Y.enum(["direct","unsupported"])}).strict(),Ga=Y.object({documentVersion:Y.number().int().nonnegative(),selectionRef:rn.optional(),items:Y.array(kf),spreads:Y.array(Af),creation:wf}).strict().superRefine((e,n)=>{let s=e.selectionRef;s&&s.instanceIndex!==void 0&&s.instanceCount!==void 0&&s.instanceIndex>=s.instanceCount&&n.addIssue({code:"custom",path:["selectionRef","instanceIndex"],message:"instanceIndex must be smaller than instanceCount"})});import{z as ve}from"zod";var Pf=ve.string().min(1).refine(e=>!e.startsWith("/")&&!e.includes(".."),{message:"Patch paths must be safe relative POSIX paths."}),Cf=ve.string().regex(/^sha256:[a-f0-9]{64}$/),vf=ve.object({path:Pf,operation:ve.enum(["create","update","delete"]),expectedHash:Cf.optional(),fullContent:ve.string().optional()}).superRefine((e,n)=>{e.operation==="delete"&&e.fullContent!==void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"delete patches must not include fullContent"}),e.operation!=="delete"&&e.fullContent===void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"create/update patches must include fullContent"})}),Df=ve.object({siteId:k,baseSnapshotId:I,operationId:ve.string().min(1),reason:ve.string().min(1),patches:ve.array(vf).min(1),changedCompositions:ve.array(z),changedRouteIds:ve.array(ve.string().min(1)).optional(),diagnostics:ve.array(ve.object({code:ve.string().min(1),message:ve.string().min(1),path:ve.string().min(1).optional()})).default([])}).strict().superRefine((e,n)=>{let s=new Set;for(let[a,o]of e.patches.entries())s.has(o.path)&&n.addIssue({code:"custom",path:["patches",a,"path"],message:`Duplicate patch path: ${o.path}`}),s.add(o.path);let i=[...new Set(e.changedCompositions.map(a=>a.routeId))];e.changedRouteIds!==void 0&&(e.changedRouteIds.length!==i.length||e.changedRouteIds.some((a,o)=>a!==i[o]))&&n.addIssue({code:"custom",path:["changedRouteIds"],message:"changedRouteIds must be the stable deduplicated route projection of changedCompositions."})}),AD=Df.transform(e=>({...e,changedRouteIds:[...new Set(e.changedCompositions.map(n=>n.routeId))]}));var qa="::repeat-item#";function Of(e,n){return`${e}${qa}${n}`}function PD(e,n){return n.reduce((s,i)=>Of(s,i),e)}function Nf(e){if(typeof e!="string"||e.length===0)return null;let n=[],s=e;for(;;){let i=s.lastIndexOf(qa);if(i<0)break;let a=Number(s.slice(i+qa.length));if(!Number.isInteger(a)||a<0)return null;n.unshift({repeatIndex:a}),s=s.slice(0,i)}return!s||n.length===0?null:{baseKey:s,parts:n}}function CD(e){return Nf(e)?.baseKey??e??null}import{z as l}from"zod";import{z as Ue}from"zod";var jf=Ue.object({placementKey:Ue.string().min(1),placementUnitKey:Ue.string().min(1),relation:Ue.enum(["before","after","prepend","append"])}).strict(),Lf=Ue.object({status:Ue.literal("supported"),containerKey:Ue.string().min(1),hasBusinessMembers:Ue.boolean(),placementUnitKeys:Ue.array(Ue.string().min(1)),placements:Ue.array(jf)}).strict().superRefine((e,n)=>{let s=new Set(e.placementUnitKeys);s.size!==e.placementUnitKeys.length&&n.addIssue({code:"custom",path:["placementUnitKeys"],message:"Render page composition placement unit keys must be unique."});let i=new Set;e.placements.forEach((a,o)=>{i.has(a.placementKey)&&n.addIssue({code:"custom",path:["placements",o,"placementKey"],message:"Render page composition placement keys must be unique."}),i.add(a.placementKey),s.has(a.placementUnitKey)||n.addIssue({code:"custom",path:["placements",o,"placementUnitKey"],message:"Render page composition placement must reference a projected unit."})})}),Mf=Ue.object({status:Ue.literal("unsupported"),reason:Ms,diagnostics:Ue.array(Bn)}).strict(),vm=Ue.discriminatedUnion("status",[Lf,Mf]);var Uf=l.object({canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean()}),Dm=l.enum(["vcp-cms-collection","vcp-cms-form","vcp-cms-settings","vcp-cms-navigation","site-api-route","external-api","unknown-api"]),Ff=l.enum(["cms-field","api-field"]),Gf=l.enum(["text","attribute","richtext","repeat-region","conditional-region","component-prop"]),qf=l.enum(["exact","safe-derived","partial","unknown"]),Wf=l.object({file:l.string().min(1),symbol:l.string().min(1).optional(),reason:l.string().min(1)}),Bf=l.object({sourceKind:Dm,sourceType:Ff,endpointPattern:l.string().min(1).optional(),operation:l.string().min(1).optional(),collection:l.string().min(1).optional(),fieldPath:l.string().min(1).optional(),valuePath:l.string().min(1).optional(),targetKind:Gf,targetName:l.string().min(1),confidence:qf,readonly:l.literal(!0),evidence:l.array(Wf)}),Om=l.object({hasDynamicData:l.boolean(),bindings:l.array(Bf)}),Nm=l.object({hasDynamicData:l.boolean(),sourceKinds:l.array(Dm),collections:l.array(l.string().min(1)).min(1).optional(),primaryEndpoint:l.string().min(1).optional(),primaryCollection:l.string().min(1).optional(),primaryFieldPath:l.string().min(1).optional()}),Kf=l.discriminatedUnion("kind",[l.object({kind:l.literal("route-unit")}).strict(),l.object({kind:l.literal("source-siblings"),siblingKeys:l.array(l.string().min(1)).min(2)}).strict(),l.object({kind:l.literal("unavailable")}).strict()]),zf=l.object({key:l.string().min(1),parentKey:l.string().min(1).nullable().optional(),pageCompositionUnitKey:l.string().min(1).optional(),pageCompositionActionScope:Kf.optional(),operationSummary:Uf,dynamicDataSummary:Nm.optional()}).strict(),$D=l.object({composition:he}).strict(),VD=l.object({key:l.string().min(1),composition:he,selectionRef:rn.optional()}).strict(),YD=l.object({siteId:k,snapshotId:I,composition:z,version:l.number().int().nonnegative(),entries:l.array(zf),pageComposition:vm}).strict(),jm=l.object({kind:l.enum(["literal","binding","imported-binding","repeat-template"]),file:l.string().min(1),expression:l.string().min(1),bindingName:l.string().min(1).optional(),path:l.array(l.union([l.string(),l.number()])).optional()}),Wa=l.object({index:l.number().int().min(0),value:l.string(),editable:l.boolean(),source:jm.nullable()}),Qn=l.object({key:l.string().min(1),label:l.string().min(1),tag:l.string().min(1)}),XD=l.object({composition:z,key:l.string().min(1),canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean(),boundaryKind:Xs.nullable(),isOpaque:l.boolean()}).strict(),Hf=l.object({kind:l.enum(["jsx-node","component-proxy","value-binding","route-export"]),file:l.string().min(1),componentName:l.string().min(1),isProxy:l.boolean()}),Lm=l.object({kind:l.union([l.enum(["jsx-literal","component-prop","binding","imported-binding","object-field","array-item","repeat-template","conditional-branch"]),Js]),file:l.string().min(1),displayPath:l.string().min(1),externalSource:l.object({sourceType:Js,sourceId:l.string().min(1),adapterId:l.string().min(1).optional()}).optional()}),$f=l.object({kind:Lm.shape.kind,file:l.string().min(1),displayName:l.string().min(1),canEditHere:l.boolean()}),Zn=l.object({finalSource:Lm.nullable(),chain:l.array($f),confidence:l.enum(["exact","safe-derived","partial","unknown"]),editMode:l.enum(["direct","proxy","upstream","readonly","unsupported"]),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)}))}),Vf=l.object({kind:l.literal("css-style-model"),properties:l.array(l.object({property:Cc,value:l.union([l.string(),l.number(),l.boolean(),l.null()]),resolvedValue:l.union([l.string(),l.number(),l.boolean(),l.null()]).optional(),breakpoint:Dc.optional(),state:vc.optional(),variants:l.array(l.string().min(1)).optional(),options:l.array(l.union([l.string(),l.number()])).optional(),editable:l.boolean(),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)})).optional(),operationBoundary:l.array(Kn).optional()}))}),QD=l.union([l.record(l.string(),l.unknown()),Vf]),Mm=l.object({kind:l.literal("class-name-source"),className:l.string(),sourceKind:l.enum(["missing","static-attribute","static-expression","dynamic-expression"]),editable:l.boolean(),operationBoundary:l.array(Kn),sourcePath:l.string().min(1).optional(),diagnostics:l.array(l.object({code:l.enum(["missing-class-name","dynamic-binding","non-string-binding"]),message:l.string().min(1)})).optional()}),Yf=l.object({startLine:l.number().int().positive(),startColumn:l.number().int().nonnegative(),endLine:l.number().int().positive(),endColumn:l.number().int().nonnegative()}),Ba=l.object({sourceFile:l.string().min(1),componentName:l.string().min(1),openingElementRange:Yf,structuralPath:l.string().min(1),textPreview:l.string().min(1).optional()}),Um=l.enum(["native-anchor","next-link","unsupported"]),ZD=l.object({composition:z,key:l.string().min(1),tag:l.string().min(1),linkSourceKind:Um.optional(),componentName:l.string().min(1),sourceFile:l.string().min(1),sourceLocator:Ba.optional(),label:l.string().min(1),capabilities:Qs,writeTarget:Hf,effectiveWriteTarget:Fa.optional(),provenanceChain:Zn.optional(),componentSemantic:l.record(l.string(),l.unknown()).optional(),styleSource:Mm.optional(),conditional:l.record(l.string(),l.unknown()).optional(),dynamicData:Om.optional(),properties:Ga.optional(),textSegments:l.array(Wa),boundaryKind:Xs.nullable(),isOpaque:l.boolean(),ancestors:l.array(Qn),children:l.array(Qn),siblings:l.array(Qn)}).strict(),JD=l.object({composition:z,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:Ba.optional(),capabilities:l.object({constraints:Qs.shape.constraints}),isOpaque:l.boolean(),provenanceChain:l.object({editMode:Zn.shape.editMode,diagnostics:Zn.shape.diagnostics}).optional(),dynamicDataSummary:Nm.optional(),ancestors:l.array(Qn)}).strict(),eO=l.object({composition:z,key:l.string().min(1),tag:l.string().min(1),linkSourceKind:Um.optional(),label:l.string().min(1),sourceLocator:Ba.optional(),isOpaque:l.boolean(),ancestors:l.array(Qn),componentName:l.string().min(1),sourceFile:l.string().min(1),capabilities:Qs,provenanceChain:l.object({editMode:Zn.shape.editMode,diagnostics:Zn.shape.diagnostics}).optional(),textSegments:l.array(l.object({index:Wa.shape.index,editable:Wa.shape.editable,sourceKind:jm.shape.kind.nullable()})),dynamicData:Om.optional(),properties:Ga.optional(),boundaryKind:Xs.nullable()}).strict(),tO=l.object({composition:z,key:l.string().min(1),styleSource:Mm.optional()}).strict();var Xf=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Qf=["article","aside","div","footer","form","header","li","main","nav","ol","section","select","table","tbody","tfoot","thead","tr","ul"],Zf=["a","button","em","h1","h2","h3","h4","h5","h6","label","p","small","span","strong"],Jf=new Set(Xf),eb=new Set(Qf),tb=new Set(Zf),nb={canUpdateText:!1,canInsertChild:!1,canMove:!1,canRemove:!1};function sO(e){return Jf.has(Ka(e))}function sb(e){return eb.has(Ka(e))}function ib(e){return tb.has(Ka(e))}function iO(e){let{operationSummary:n}=e;return n?{canUpdateText:n.canUpdateText,canInsertChild:n.canInsertChild,canMove:n.canMove,canRemove:n.canRemove}:e.fallbackMode!=="preview"?{...nb}:{canUpdateText:ib(e.tagName),canInsertChild:sb(e.tagName),canMove:!1,canRemove:!1}}function Ka(e){return e?.trim().toLowerCase()??""}import{z as ab}from"zod";var mO=ab.object({composition:he,mutationContext:qn.optional()}).strict();var pO={PATCH_VALIDATION_FAILED:"The code didn't pass validation. Try describing the change more specifically.",PATCH_BATCH_FAILED:"The site code couldn't be generated. Please regenerate the site.",PATCH_BATCH_INVALID:"The change couldn't be applied. Try simpler instructions.",VALIDATION_FAILED:"Your message couldn't be sent as written. Please edit it and try again.",WORKSPACE_MESSAGE_CONTAINS_SECRET:"Your message looks like it contains a secret or token, so it wasn't sent. Remove it and try again.",WORKSPACE_RUN_INPUT_REQUIRED:"Nothing to work on: the request had no instruction, so no edit was started. Describe the change you want and send it.",WORKSPACE_TOOL_RESULT_INVALID:"This change couldn't be completed and was rolled back. Please try again.",WORKSPACE_TOOL_FAILED:"A tool step failed. Please try again.",WORKSPACE_TOOL_RESULT_MISSING:"The tool didn't return a usable result. Please try again.",WORKSPACE_MODEL_STREAM_FAILED:"The model stream ended unexpectedly. Please try again.",WORKSPACE_MODEL_STREAM_ABORTED:"Generation was interrupted before finishing. Please try again.",MODEL_OUTPUT_TRUNCATED:"The response was too long and was cut off before any change was applied. Try again, or split the request into smaller changes.",WORKSPACE_EDIT_NOT_APPLIED:"No change was applied. Try describing the change differently.",PRODUCT_SEARCH_APPLY_NOT_AVAILABLE:"Product search changes aren't available yet. Please try again later.",WORKSPACE_INITIAL_EXECUTION_FAILED:"Initial generation failed. Please retry from the brief.",WORKSPACE_INITIAL_GENERATION_CHECK_FAILED:"Initial generation could not be verified. Please retry.",WORKSPACE_INITIAL_GENERATION_FINALIZE_FAILED:"Initial generation could not finalize. Please retry.",WORKSPACE_INITIAL_GENERATION_QUALITY_GATE_FAILED:"Initial generation failed quality checks. Please regenerate the site.",WORKSPACE_CHECK_INCOMPLETE:"The check couldn't complete, so no page was delivered this round. Please regenerate the site.",WORKSPACE_RUN_RESUME_EXHAUSTED:"Generation was interrupted several times and stopped. Everything already saved is kept; you can regenerate the missing pages.",WORKSPACE_GENERATION_STOPPED:"You stopped this generation before any page was ready. Nothing was lost \u2014 start it again when you want.",WORKSPACE_FILL_IN_INTERRUPTED:"The fill-in run was interrupted and stopped. Your site is unchanged; select the targets again to retry.",WORKSPACE_RUN_LEASE_SUPERSEDED:"Another attempt took over this run, so this one stopped. Reload to see the current progress.",FILL_IN_NOT_AVAILABLE:"Fill-in is available after the site has been generated.",FILL_IN_TARGET_NOT_OMITTED:"One of the selected items is no longer listed as missing. Reload the omissions list and try again.",FILL_IN_TARGET_MODIFIED:"One of the selected items was changed or removed after generation, so it was not filled in. Your edits are kept.",WORKSPACE_ITERATION_QUALITY_GATE_FAILED:"Quality check failed. The change was rolled back; try a smaller or more specific request.",WORKSPACE_RESOURCE_MATERIALIZATION_FAILED:"The resource couldn't be prepared. Check its file format, dependencies, and target paths before trying again.",DESIGNER_PAGE_RESOURCE_INCOMPATIBLE:"This template contains files or dependencies the page editor doesn't support. Choose another template or adapt the resource package first.",WORKSPACE_SOCKET_DEAD:"The workspace connection was lost. Please retry.",WORKSPACE_RUN_CANCELLED:"The run was cancelled.",WORKSPACE_RUN_ABANDONED:"This run was interrupted and did not finish. Please try again.",WORKSPACE_RUN_REQUEST_FAILED:"Couldn't start the workspace. Please try again.",WORKSPACE_RUN_BAD_RESPONSE:"The server response was malformed. Please try again.",WORKSPACE_SOCKET_UNAVAILABLE:"Workspace connection unavailable. Please try again.",WORKSPACE_SOCKET_ERROR:"The workspace connection had an error. Please try again.",WORKSPACE_SOCKET_CLOSED:"The workspace connection closed. Please try again.",WORKSPACE_SOCKET_OPEN_TIMEOUT:"Couldn't reach the workspace in time. Please try again.",WORKSPACE_CLIENT_MESSAGE_ID_MISSING:"Something went wrong sending your message. Please try again.",SITE_SNAPSHOT_REQUIRED:"This site has no usable snapshot yet. Complete Step 3 first.",AGENT_TIMEOUT:"That took longer than expected. Try breaking the change into smaller pieces.",SANDBOX_NOT_AVAILABLE:"The preview environment isn't ready. Your edits have still been saved.",PREVIEW_BUILD_FAILED:"Preview is available, but the production build failed. Fix the reported build error before deploying.",PREVIEW_BUILD_NOT_CONFIGURED:"Preview is available, but the production build check is not configured.",PREVIEW_BUILD_SANDBOX_NOT_FOUND:"Preview is available, but the build check could not find the active preview sandbox.",BUILD_FONT_METADATA_INVALID:"We couldn't read the font file information. Publishing is blocked until the font file is checked.",BUILD_FONT_LICENSE_UNKNOWN:"We couldn't verify this font's license. Publishing is blocked until its license is confirmed.",BUILD_FONT_LICENSE_CONFLICT:"The font file license conflicts with the verified record. Publishing is blocked until the conflict is resolved.",BUILD_FONT_LICENSE_TEXT_MISSING:"The complete font license text is missing. Publishing is blocked until it is provided.",BUILD_FONT_LICENSE_DELIVERY_FAILED:"We couldn't include the font license files in the deployment. Please try publishing again.",WS_CONNECTION_ERROR:"Connection lost. Reconnecting\u2026",USER_MESSAGE_PERSIST_FAILED:"Your message wasn't saved. Please send it again.",CLARIFICATION_REPLY_STALE:"That question has expired. Please tell me what you'd like to do now.",CLARIFY_MODEL_FAILED:"Clarify couldn't finish generating questions. Please try again.",WORKSPACE_RUN_IN_FLIGHT:"Another session is already running. Please try again in a moment.",SITE_OPERATION_LOCKED:"Another change is already running for this site. Wait for it to finish, then try again.",SITE_SITEMAP_DRAFT_STALE:"The draft was updated elsewhere. Reload the latest draft before saving.",SITE_SITEMAP_DRAFT_OPERATION_MISMATCH:"This save identity belongs to a different draft operation.",WORKSPACE_THREAD_NOT_FOUND:"That conversation no longer exists. Switching back to the default conversation.",WORKSPACE_THREAD_ARCHIVED:"This conversation is archived. Start a new one to continue.",WORKSPACE_THREAD_BUSY:"This conversation is still running. Wait for it to finish before archiving.",WORKSPACE_THREAD_READ_ONLY:"Background conversations are read-only here.",WORKSPACE_THREAD_INVALID:"This conversation can't accept new requests right now. Refresh and try again.",EDIT_ENGINE_VERSION_INVALID:"Invalid editor version. Refresh the page and try again.",SANDBOX_DEPENDENCY_SYNC_FAILED:"The preview runtime could not be prepared. Please try again.",SANDBOX_PREVIEW_FAILED:"The site preview failed to start. Please try again.",SANDBOX_DEPENDENCY_VERSION_MISMATCH:"The preview runtime could not be verified. Please try again.",SANDBOX_RUNTIME_NOT_READY:"The preview needs to be refreshed before this change can be applied. Refresh the preview and try again.",GENERIC:"Something went wrong. Please try again."},ob=["BUILD_FONT_METADATA_INVALID","BUILD_FONT_LICENSE_UNKNOWN","BUILD_FONT_LICENSE_CONFLICT","BUILD_FONT_LICENSE_TEXT_MISSING","BUILD_FONT_LICENSE_DELIVERY_FAILED"],rb=new Set(ob);function dO(e){return typeof e=="string"&&rb.has(e)}var cb=["WORKSPACE_RUN_CANCELLED","WORKSPACE_GENERATION_STOPPED"],mb=new Set(cb);function uO(e){return typeof e=="string"&&mb.has(e)}var _O={UNDO_OR_ROLLBACK:"I can't roll back from chat. Use the version history at the top right to pick a restore point.",HISTORY_RECALL:"Tell me what you'd like to change now\u2014I'll work from the current page state.",OUT_OF_SCOPE:"That's outside what I can do from chat. Try the corresponding panel on the right."},gO={CARD_HEADER:"Needs your confirmation",FREE_TEXT_PLACEHOLDER:"Or describe what you'd like instead",SUBMIT_LABEL:"Submit"},hO={SEND_FAILED_RETRY:"Send failed \u2014 tap to retry"};var Fm="0.10.49",fO="x-vcp-edit-engine-version",bO="x-vcp-edit-engine-version-source",za=class extends Error{constructor(n="Invalid edit-engine version."){super(n),this.code="EDIT_ENGINE_VERSION_INVALID",this.name="EditEngineVersionParseError"}},lb=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/;function pb(e){return lb.test(e)}function db(e){if(typeof e!="string"||!pb(e))throw new za;return e}function yO(e){return e==null?{version:Fm,source:"fallback_current"}:{version:db(e),source:"explicit"}}function xO(){return{version:Fm,source:"system_current"}}import{z as nt}from"zod";var ub=200,_b=200;function gb(e){let n=e.indexOf(":");if(n<=0)return null;let s=e.slice(0,n).trim(),i=e.slice(n+1).trim();return s.length===0||i.length===0?null:{source:s,target:i}}var hb=nt.string().min(3).max(ub).refine(e=>gb(e)!==null,{message:'glossary entries must be "source:target" pairs split on a half-width colon, e.g. "\u7C73:Rice"'}),IO=nt.array(hb).max(_b),TO=nt.object({website_name:nt.string().min(1).max(200),website_industry:nt.string().min(1).max(200).optional(),website_description:nt.string().min(1).max(1e3).optional()}),Sb=nt.enum(["regional","fonts_only"]),ei=nt.string().regex(/^#[0-9a-fA-F]{6}$/,'color must be a "#rrggbb" value'),fb=nt.object({primary:ei.optional(),accent:ei.optional(),foreground:ei.optional(),neutral:ei.optional()}),bb=600,kO=nt.object({mode:Sb.default("regional"),seeds:fb.optional(),note:nt.string().min(1).max(bb).optional()}),AO={mode:"regional"};function wO(e){return e===void 0?!1:Object.values(e).some(n=>typeof n=="string"&&n.length>0)}import{z as Vt}from"zod";var yb=12,DO=Vt.object({tenant_id:Vt.string().min(1),site_id:k,snapshot_id:I,manifest_hash:Vt.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:Vt.string().min(1).max(2048)}),ti=Vt.number().int().nonnegative().safe(),OO=Vt.object({page_count:ti,translation_character_count:ti,image_estimate:Vt.object({media_key_count:ti,max_replacement_count:ti})}).superRefine((e,n)=>{let{media_key_count:s,max_replacement_count:i}=e.image_estimate;i!==Math.min(s,yb)&&n.addIssue({code:"custom",path:["image_estimate","max_replacement_count"],message:"max replacement count does not match the deterministic ceiling"})});import{z as _e}from"zod";var xb=_e.string().trim().min(1),_n=_e.string().uuid(),Eb=_e.string().min(1).max(2048).refine(e=>e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."),"object_key must be a relative snapshot store path without empty, '.' or '..' segments"),Gm=_e.object({snapshot_id:_n,object_key:Eb}),LO=_e.object({tenant_id:xb,parent_site_id:_n,subsite_site_id:_n,base:Gm,target:Gm}),Rb=_e.object({page_path:_e.string().min(1),page_route:_e.string().min(1).describe("\u4E3B\u7AD9\u76EE\u6807\u5FEB\u7167\u7684\u9875\u9762\u8DEF\u7531\uFF1A\u4F18\u5148 PAGE_SEO.path\uFF0C\u7F3A\u5931\u65F6\u7531\u6587\u4EF6\u8DEF\u7531\u63A8\u5BFC\uFF1B\u52A8\u6001\u9875\u4FDD\u7559\u8DEF\u7531\u6A21\u677F\uFF0C\u4E0D\u542B\u57DF\u540D\u6216\u5B50\u7AD9\u6302\u8F7D\u524D\u7F00\u3002"),page_title:_e.string().nullable().describe("\u4E3B\u7AD9\u76EE\u6807\u5FEB\u7167\u4E2D\u7684\u9759\u6001 PAGE_SEO.title\uFF1B\u7F3A\u5931\u6216\u52A8\u6001\u503C\u8FD4\u56DE null\uFF0C\u4E0D\u67E5\u8BE2 CMS \u6807\u9898\u8986\u76D6\u3002"),ai_image_count:_e.number().int().nonnegative().safe().describe("\u9875\u9762\u5F15\u7528\u7684\u5A92\u4F53\u6CE8\u518C\u8868 key \u6570\u91CF\uFF0C\u9875\u5185\u53BB\u91CD\uFF0C\u4E0D\u9650 12 \u5F20\uFF1B\u8868\u793A\u53EF\u4F9B AI \u91CD\u65B0\u751F\u6210\u7684\u5019\u9009\u56FE\u7247\u6570\u3002"),translation_character_count:_e.number().int().nonnegative().safe().describe("\u6574\u9875\u53EF\u9759\u6001\u63D0\u53D6\u7684\u6587\u6848\u53CA\u76F8\u5173\u56FE\u7247 alt\uFF0C\u539F\u6587\u53BB\u91CD\u540E\u7684 UTF-16 \u5B57\u7B26\u6570\uFF0C\u4E0D\u6263\u9664\u5386\u53F2\u8BD1\u6587\u3002")}),Ib={page_count:_e.number().int().nonnegative().safe().describe("\u65B0\u589E\u9875\u9762\u6570\u91CF\uFF0C\u7B49\u4E8E pending_pages \u957F\u5EA6\u3002"),ai_image_count:_e.number().int().nonnegative().safe().describe("\u9010\u9875\u5019\u9009\u56FE\u7247\u6570\u91CF\u4E4B\u548C\uFF0C\u8DE8\u9875\u4E0D\u53BB\u91CD\uFF0C\u4E0D\u8868\u793A\u5DF2\u7531 AI \u751F\u6210\u7684\u56FE\u7247\u6570\u3002"),translation_character_count:_e.number().int().nonnegative().safe().describe("\u9010\u9875\u9884\u4F30\u7FFB\u8BD1\u5B57\u7B26\u6570\u4E4B\u548C\uFF0C\u8DE8\u9875\u4E0D\u53BB\u91CD\uFF0C\u4E0D\u8868\u793A\u5B9E\u9645\u7FFB\u8BD1\u6D88\u8017\u3002"),page_estimates:_e.array(Rb)};function Tb(e,n){let s=new Set(e.pending_pages),i=new Set(e.page_estimates.map(a=>a.page_path));(s.size!==e.pending_pages.length||i.size!==e.page_estimates.length||s.size!==i.size||[...s].some(a=>!i.has(a)))&&n.addIssue({code:"custom",path:["page_estimates"],message:"page_estimates must correspond to pending_pages exactly once"});for(let[a,o]of[["page_count",e.pending_pages.length],["ai_image_count",e.page_estimates.reduce((c,r)=>c+r.ai_image_count,0)],["translation_character_count",e.page_estimates.reduce((c,r)=>c+r.translation_character_count,0)]])e[a]!==o&&n.addIssue({code:"custom",path:[a],message:"total must equal the sum of page estimates"})}var MO=_e.object({...Ib,subsite_site_id:_n,pending_pages:_e.array(_e.string().min(1)),hash_diverged_count:_e.number().int().nonnegative(),child_only_count:_e.number().int().nonnegative(),base_snapshot_id:_n,target_snapshot_id:_n}).superRefine(Tb),kb=_e.enum(["SUBSITE_DIFF_REQUEST_INVALID","SUBSITE_DIFF_STORE_NOT_CONFIGURED","SUBSITE_DIFF_MANIFEST_MISSING","SUBSITE_DIFF_MANIFEST_INVALID","SUBSITE_DIFF_ESTIMATE_INVALID"]),UO=_e.object({error_code:kb,message:_e.string().min(1),side:_e.enum(["base","target"]).optional()});import{z as ne}from"zod";var WO=ne.object({tenant_id:ne.string().min(1),site_id:k,snapshot_id:I,manifest_hash:ne.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:ne.string().min(1).max(2048),page_slug:ne.string().max(512).optional()}),BO=ne.object({site_id:k,snapshot_id:I,unit_count:ne.number().int().nonnegative(),file_count:ne.number().int().nonnegative(),markdown:ne.string().min(1),page_slug:ne.string().optional(),page_file:ne.string().optional(),entries:ne.array(ne.object({id:ne.string().min(1),file_path:ne.string().min(1),line:ne.number().int().nullable(),kind:ne.string().min(1),text:ne.string(),media_key:ne.string().optional()})).optional(),images:ne.array(ne.object({id:ne.string().min(1),source:ne.enum(["media-registry","source-literal"]),src:ne.string().min(1),alt:ne.string().nullable(),media_key:ne.string().optional(),width:ne.number().optional(),height:ne.number().optional(),provider:ne.string().optional(),is_placeholder:ne.boolean(),occurrences:ne.array(ne.object({file_path:ne.string().min(1),line:ne.number().int()}))})).optional()});import{z as Ab}from"zod";var wb=/^\/[a-z0-9][a-z0-9-]{0,30}$/,Pb=Object.freeze(["api","_next","assets","static","robots.txt","sitemap.xml",".well-known"]),Cb=new Set(Pb);function vb(e){return Cb.has(e)}var HO=Ab.string().regex(wb).refine(e=>!vb(e.slice(1)),{message:"mount_path must not use a reserved segment (api, _next, assets, static, robots.txt, sitemap.xml, .well-known)"});import{z as Se}from"zod";var Db=Se.enum(["active","paused","blocked"]),qm=Se.enum(["typecheck_failed","health_failed","validation_failed"]),Ob={status:Db,attempts:Se.number().int().nonnegative(),attempted_template_version:et.nullable(),last_error_code:qm.nullable()},gn=Se.object(Ob).strict(),ni=Se.object({template_id:Se.string().trim().min(1),target_template_version:et}).strict(),XO=ni,Nb=Se.discriminatedUnion("action",[Se.object({action:Se.literal("proceed"),state:gn.extend({status:Se.literal("active")})}).strict(),Se.object({action:Se.literal("skip_not_newer"),state:gn.extend({status:Se.literal("active")})}).strict(),Se.object({action:Se.literal("skip_paused"),state:gn.extend({status:Se.literal("paused")})}).strict(),Se.object({action:Se.literal("skip_blocked"),state:gn.extend({status:Se.literal("blocked")})}).strict()]),QO=ni,ZO=Nb,JO=ni.extend({error_code:qm}),eN=Se.object({state:gn}).strict(),tN=ni,nN=Se.object({state:gn}).strict();import{z as X}from"zod";var jb=744*60*60*1e3,Lb=X.enum(["eligible","fast_path","upgraded","skipped","lock_skipped","cas_aborted","validation_failed","blocked","paused"]),Mb=X.enum(["typecheck","build","health","validation"]),Ub=X.enum(["not_attempted","promoted","aborted"]),rN=X.object({template_id:X.string().trim().min(1).max(128),from_version:et.nullable(),to_version:et,outcome:Lb,attempt:X.number().int().nonnegative().max(2147483647),duration_ms:X.number().int().nonnegative().max(2147483647),replaced_group_count:X.number().int().nonnegative().max(2147483647),skipped_group_count:X.number().int().nonnegative().max(2147483647),validation_stage:Mb.nullable(),cas_outcome:Ub.nullable()}).strict(),cN=X.object({recorded:X.literal(!0)}).strict(),Wm=X.object({from:X.iso.datetime(),to:X.iso.datetime()}).strict().refine(({from:e,to:n})=>Date.parse(e)<Date.parse(n),{message:"from must be earlier than to",path:["to"]}).refine(({from:e,to:n})=>Date.parse(n)-Date.parse(e)<=jb,{message:"report window must not exceed 31 days",path:["to"]}),mN=Wm,Fb=X.object({eligible:X.number().int().nonnegative(),fast_path:X.number().int().nonnegative(),upgraded:X.number().int().nonnegative(),skipped:X.number().int().nonnegative(),lock_skipped:X.number().int().nonnegative(),cas_aborted:X.number().int().nonnegative(),validation_failed:X.number().int().nonnegative(),blocked:X.number().int().nonnegative(),paused:X.number().int().nonnegative()}).strict(),lN=X.object({window:Wm,outcome_counts:Fb,current_state_counts:X.object({blocked:X.number().int().nonnegative(),paused:X.number().int().nonnegative()}).strict(),duration_ms:X.object({p50:X.number().int().nonnegative().nullable(),p95:X.number().int().nonnegative().nullable(),sample_count:X.number().int().nonnegative()}).strict()}).strict(),pN=X.object({older_than:X.iso.datetime(),limit:X.coerce.number().int().min(1).max(200).default(50),include_candidates:X.enum(["true","false"]).default("false").transform(e=>e==="true")}).strict(),Gb=X.object({site_id:k,snapshot_id:I,status:X.enum(["candidate","deleting"]),created_at:X.iso.datetime()}).strict(),dN=X.object({snapshots:X.array(Gb)}).strict();import{z as xt}from"zod";var qb=xt.enum(["PREVIEW_SESSION_NOT_FOUND","PREVIEW_SESSION_INVALID","PREVIEW_SESSION_STALE","PREVIEW_SESSION_LOOKUP_FAILED","PREVIEW_SANDBOX_NOT_FOUND","PREVIEW_SANDBOX_CONNECT_FAILED","PREVIEW_SANDBOX_OWNERSHIP_MISMATCH","PREVIEW_ACTIVATION_TIMEOUT","PREVIEW_PREFLIGHT_FAILED","PREVIEW_ENV_LOOKUP_FAILED","PREVIEW_SERVER_START_FAILED","PREVIEW_HEALTH_CHECK_FAILED","SANDBOX_NOT_CONFIGURED"]),Wb=xt.object({status:xt.literal("ready"),preview_url:xt.string().url()}).strict(),Bb=xt.object({status:xt.literal("failed"),code:qb,message:xt.string().min(1),retryable:xt.boolean()}).strict(),gN=xt.discriminatedUnion("status",[Wb,Bb]);import{z as Dt}from"zod";var Kb=["not_started","active","completed"],zb=Dt.enum(Kb),Hb=["not_started","in_progress","completed"],$b=Dt.enum(Hb),Vb=Dt.object({sequence:Dt.number().int().positive(),code:At,status:$b}).strict(),Yb=Dt.object({site_id:k,workflow_status:zb,flow_type:cn.nullable(),current_step_code:At.nullable(),completed_count:Dt.number().int().nonnegative(),total_count:Dt.number().int().nonnegative(),steps:Dt.array(Vb)}).strict().superRefine((e,n)=>{let s=e.steps.filter(i=>i.status==="completed").length;e.total_count!==e.steps.length&&n.addIssue({code:"custom",path:["total_count"],message:"total_count must equal steps.length."}),e.completed_count!==s&&n.addIssue({code:"custom",path:["completed_count"],message:"completed_count must equal completed steps."}),e.steps.forEach((i,a)=>{i.sequence!==a+1&&n.addIssue({code:"custom",path:["steps",a,"sequence"],message:"Step sequence must be continuous and start at 1."})}),e.workflow_status==="not_started"&&(e.flow_type!==null&&n.addIssue({code:"custom",path:["flow_type"],message:"not_started progress cannot have a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"not_started progress cannot have a current step."}),(e.completed_count!==0||e.total_count!==0)&&n.addIssue({code:"custom",path:["steps"],message:"not_started progress must have zero counts and no steps."})),e.workflow_status==="active"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"active progress requires a flow_type."}),e.current_step_code===null&&n.addIssue({code:"custom",path:["current_step_code"],message:"active progress requires a current step."})),e.workflow_status==="completed"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"completed progress requires a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"completed progress cannot have a current step."}),e.steps.some(i=>i.status!=="completed")&&n.addIssue({code:"custom",path:["steps"],message:"completed progress must have only completed steps."}),e.completed_count!==e.total_count&&n.addIssue({code:"custom",path:["completed_count"],message:"completed progress counts must be equal."}))}),xN=U(Yb);import{z as Ha}from"zod";var Xb=Ha.enum(["none","build","build_publish"]),Qb=Ha.object({site_id:k,launcher_scope:Xb}),TN=Ha.object({permission:Qb});function kN(e){return e!=="none"}function AN(e){return e==="build_publish"}import{z as be}from"zod";var ON="build-context.json",NN=2e5,Bm=be.string().regex(/^sha256:[a-f0-9]{64}$/u),Km=1e3;function Zb(e){return Array.from(e).length<=Km}var Jb=be.object({kind:be.enum(["customer_materials","website_scan_diagnosis","committed_strategy"]),digest:Bm}).strict(),ey=be.object({schema_version:be.literal(1),flow_type:cn,sources:be.array(Jb).min(2).max(2)}).strict().superRefine((e,n)=>{let s=new Set(e.sources.map(a=>a.kind)),i=e.flow_type==="with_website"?["website_scan_diagnosis","committed_strategy"]:["customer_materials","committed_strategy"];(s.size!==i.length||i.some(a=>!s.has(a)))&&n.addIssue({code:"custom",path:["sources"],message:"Site-build provenance sources must match the persisted workflow flow."})}),ty=be.object({schema_version:be.literal(1),seed:Bm.optional(),cms_settings:be.object({main_products:be.string().trim().min(1).refine(Zb,{message:`main_products must contain at most ${Km} characters`}).optional()}).strict().optional(),provenance:ey.optional()}).strict(),ny=be.object({schema_version:be.literal(1),site_id:k,workflow_id:ot,brief:be.string().min(1),source:be.enum(["business_provider","mock"]),payload:ty}).strict().superRefine((e,n)=>{e.source==="business_provider"&&!e.payload.provenance&&n.addIssue({code:"custom",path:["payload","provenance"],message:"Business site-build context requires persisted provenance."})}),jN=be.object({source_snapshot_id:I,source_run_id:V,build_context:ny,page_slugs:be.array(be.string().min(1)).optional()}).strict(),LN=be.object({disposition:be.enum(["reused","rebased"]),snapshot_id:I}).strict(),sy=be.object({snapshot:ha,workspace_run_id:V.nullable()}).strict(),MN=U(sy);import{z as mt}from"zod";import{z as Ve}from"zod";import{z as De}from"zod";import{z as iy}from"zod";var ay=["brand","fact","cert","case","svc","faq","voice"],zm=iy.enum(ay);var oy=De.enum(["pending","running","ready","failed","missing"]),Jn=De.string().trim().min(1).max(255),BN=De.object({knowledge_site_id:Jn,source_ids:De.array(Jn).min(1).max(200)}).strict().superRefine((e,n)=>{new Set(e.source_ids).size!==e.source_ids.length&&n.addIssue({code:"custom",message:"Knowledge source IDs must be unique.",path:["source_ids"]})}),ry=De.object({source_file_id:Jn,category_code:zm.nullable(),category_confirmed:De.boolean(),status:oy}).strict(),KN=De.object({ready:De.boolean(),files:De.array(ry),counts:De.object({total:De.number().int().nonnegative(),pending:De.number().int().nonnegative(),running:De.number().int().nonnegative(),ready:De.number().int().nonnegative(),failed:De.number().int().nonnegative(),missing:De.number().int().nonnegative(),unclassified:De.number().int().nonnegative()}).strict()}).strict();var Ee=e=>Ve.string().trim().max(e),Hm=Ve.array(Ve.string().trim().min(1).max(120)).max(20),$a=Ve.object({company_name:Ve.string().trim().min(1).max(200),brand_name:Ee(200),primary_products:Ve.string().trim().min(1).max(1e3),industry:Ee(200),applications:Ee(1e3),business_summary:Ee(2e3),registered_capital:Ee(200).default(""),legal_representative:Ee(200).default(""),target_markets:Hm,customer_industries:Ee(1e3),customer_roles:Ee(1e3),buying_scenarios:Ee(2e3),differentiators:Ee(2e3),competitors:Ee(1e3),trust_proof:Ee(2e3),customer_cases:Ee(3e3),channels:Hm,expected_domain:Ee(255),brand_tone:Ee(500),contact_name:Ee(200),contact_info:Ee(500),timezone:Ee(100),launch_timing:Ee(200),input_source_ids:Ve.array(Jn).max(50)}).strict(),cy=Ve.enum(["draft","submitted"]),Va=$a.extend({id:Z,tenant_id:Ve.string().min(1),site_id:k,workflow_id:ot,status:cy,submitted_at:Ve.string().min(1).nullable(),created_at:Ve.string().min(1),updated_at:Ve.string().min(1)}).strict(),XN=U(Va),QN=U(Va),ZN=U(Va.nullable());var sj=Ws.extend({expected_current_node:mt.literal("website_scan"),type:mt.literal("existing_site"),result:Ws.shape.result.extend({website:mt.string().url(),scan_cards:mt.partialRecord(tm,Ia).refine(e=>Object.keys(e).length>0,{message:"At least one recognized scan card is required."})}).strict()}).strict(),ij=mt.object({expected_current_node:mt.literal("customer_materials"),materials:$a}).strict(),aj=mt.object({expected_current_node:mt.literal("diagnosis")}).strict(),oj=mt.object({expected_current_node:mt.literal("strategy")}).strict();import{z as j}from"zod";var Ya=["compact","comfortable","airy"],$m=["none","sm","md","lg","xl"],Vm="lg",Xa=["subtle","moderate","expressive"],my=[{id:"subtle",motionLevel:"subtle"},{id:"moderate",motionLevel:"moderate"},{id:"expressive",motionLevel:"expressive"}];function Ym(e){let n=my.find(s=>s.id===e);if(!n)throw new Error(`Unknown motion preset: ${e}`);return n}var Xm=["ocean","forest","clay","violet","graphite","crimson"],Qm=["ai-forest","ai-navy","ai-steel"],Zm=/^gen-[0-9a-f]{8}$/,Qa=[{id:"ai-forest",name:"\u5DE5\u4E1A\u58A8\u7EFF \xB7 Industrial Teal",description:"\u6C89\u7A33\u4E13\u4E1A\uFF0C\u7A81\u51FA\u7CBE\u5BC6\u4E0E\u53EF\u4FE1\u3002",fallbackReason:"\u7A33\u5B9A\u4E13\u4E1A\u7684\u9ED8\u8BA4\u9009\u62E9\u3002",colorSeeds:{primary:"#0E7C6F",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"sm"},{id:"ai-navy",name:"\u79D1\u6280\u6DF1\u84DD \xB7 Deep Tech Blue",description:"\u7406\u6027\u79D1\u6280\u611F\uFF0C\u5F3A\u8C03\u6280\u672F\u5B9E\u529B\u4E0E\u6570\u636E\u53EF\u4FE1\u3002",fallbackReason:"\u6280\u672F\u8868\u8FBE\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#1E3A8A",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"md"},{id:"ai-steel",name:"\u7CBE\u5BC6\u94F6\u7070 \xB7 Precision Steel",description:"\u514B\u5236\u6E05\u6670\uFF0C\u9002\u5408\u53C2\u6570\u4E0E\u5DE5\u7A0B\u7EC6\u8282\u8868\u8FBE\u3002",fallbackReason:"\u53C2\u6570\u4FE1\u606F\u8F83\u591A\u65F6\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#475569",accent:"#94A3B8",foreground:"#111827"},surfaceMode:"light",radius:"none"}],Za=[{id:"ocean",colorSeeds:{primary:"#1e3a5f",accent:"#2563eb",foreground:"#0f172a"},surfaceMode:"light",radius:"md"},{id:"forest",colorSeeds:{primary:"#14532d",accent:"#16a34a",foreground:"#0f172a"},surfaceMode:"light",radius:"lg"},{id:"clay",colorSeeds:{primary:"#7c2d12",accent:"#ea580c",foreground:"#1c1917"},surfaceMode:"light",radius:"xl"},{id:"violet",colorSeeds:{primary:"#3b0764",accent:"#7c3aed",foreground:"#18181b"},surfaceMode:"light",radius:"lg"},{id:"graphite",colorSeeds:{primary:"#1f2937",accent:"#0d9488",foreground:"#111827"},surfaceMode:"light",radius:"none"},{id:"crimson",colorSeeds:{primary:"#7f1d1d",accent:"#dc2626",foreground:"#1f1012"},surfaceMode:"light",radius:"sm"}];function mj(e){let n=Za.find(s=>s.id===e);if(!n)throw new Error(`Unknown theme preset: ${e}`);return n}function Jm(e){return Za.find(n=>n.id===e)?.radius??Qa.find(n=>n.id===e)?.radius}var Ja=j.string().regex(/^#[0-9A-F]{6}$/i),es=j.string().trim().min(1).max(500),el=j.string().datetime({offset:!0}),ly=j.enum(Xm),py=j.enum(Qm),dy=j.string().regex(Zm),ts=j.union([ly,py,dy]),ns=j.enum(va),ss=j.enum(Xa),is=j.enum(Ya),si=j.enum($m),tl=300,uy=j.string().trim().min(1).max(tl),ii=j.object({primary:Ja,accent:Ja,foreground:Ja}).strict(),_y=j.object({id:ts,rank:j.number().int().min(1).max(3),name:j.string().trim().min(1).max(120),description:j.string().trim().min(1).max(240),color_seeds:ii,surface_mode:j.enum(["light","dark"]),radius:si,font_pairing_id:ns,motion_preset_id:ss,density:is,weight_style:Ke.optional(),reason:es}).strict(),nl=j.object({name:j.string().trim().min(1).max(120),description:j.string().trim().min(1).max(240),reason:es,color_seeds:ii,surface_mode:j.enum(["light","dark"]),radius:si,font_pairing_id:ns,motion_preset_id:ss,density:is,weight_style:Ke}).strict(),sl=j.object({version:j.number().int().min(1),recommendation_id:j.string().uuid(),theme_preset_id:ts,color_seeds:ii,surface_mode:j.enum(["light","dark"]),font_pairing_id:ns,motion_preset_id:ss,density:is,radius:si.optional(),weight_style:Ke.optional(),aesthetic_note:uy.optional(),updated_at:el}).strict(),gy=j.object({id:j.string().uuid(),version:j.number().int().min(1),catalog_version:j.string().trim().min(1).max(80),source:j.object({mode:j.enum(["ai","fallback"]),fallback_reason:j.string().trim().min(1).max(80).nullable()}).strict(),inputs:j.object({industry:j.string().trim().min(1).max(160).optional(),site_language:j.string().trim().min(2).max(35),owner_locale:Te.optional(),strategy_version:j.number().int().min(1),input_digest:j.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict(),theme:j.object({recommended_id:ts,candidate_ids:j.array(ts).length(3),candidates:j.array(_y).length(3)}).strict().superRefine((e,n)=>{e.recommended_id!==e.candidate_ids[0]&&n.addIssue({code:"custom",path:["recommended_id"],message:"recommended_id must be the first candidate"}),e.candidates.some((s,i)=>s.id!==e.candidate_ids[i]||s.rank!==i+1)&&n.addIssue({code:"custom",path:["candidates"],message:"Candidates must follow candidate_ids order."})}),font:j.object({recommended_id:ns,reason:es}).strict(),motion:j.object({recommended_id:ss,reason:es}).strict(),density:j.object({recommended_id:is,reason:es}).strict(),conversion:Gt.optional(),generated_at:el}).strict(),yj=j.object({force_refresh:j.boolean().optional()}).strict(),xj=j.object({request_id:j.string().trim().min(1).max(160),site_id:k,cached:j.boolean(),recommendation:gy,selection:sl}).strict(),Ej=j.object({recommendation_id:j.string().uuid(),expected_version:j.number().int().min(1),theme_preset_id:ts,color_seeds:ii,surface_mode:j.enum(["light","dark"]),font_pairing_id:ns,motion_preset_id:ss,density:is,radius:si.optional(),weight_style:Ke.optional(),aesthetic_note:j.string().trim().max(tl).optional()}).strict(),Rj=j.object({selection:sl}).strict(),hy=4e3,Ij=j.object({tenant_id:j.string().trim().min(1).max(160),site_id:k,site_language:j.string().trim().min(2).max(35),owner_locale:Te,industry:j.string().trim().min(1).max(160).optional(),strategy_version_id:j.string().uuid(),strategy_version:j.number().int().min(1),strategy_checksum:j.string().regex(/^[a-f0-9]{64}$/),strategy_summary:j.array(j.string().trim().min(1).max(hy)).min(1).max(je)}).strict(),eo=j.object({theme_candidates:j.array(nl).length(3),conversion:Gt.optional()}).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,a)=>{let o=JSON.stringify(i.color_seeds).toUpperCase();s.has(o)&&n.addIssue({code:"custom",path:["theme_candidates",a,"color_seeds"],message:"Theme candidates must have pairwise distinct color_seeds"}),s.add(o)})});function Tj(){return Qa.map(e=>nl.parse({name:e.name,description:e.description,reason:e.fallbackReason,color_seeds:e.colorSeeds,surface_mode:e.surfaceMode,radius:e.radius,font_pairing_id:va[0],motion_preset_id:Xa[0],density:Ya[1],weight_style:Ks}))}function Sy(e){return e.radius??Jm(e.theme_preset_id)??"lg"}function fy(e,n){return e.weight_style??n?.theme?.candidates?.find(s=>s.id===e.theme_preset_id)?.weight_style??n?.theme?.candidates?.[0]?.weight_style??Ks}function kj(e,n){let s=um(e.font_pairing_id),i=Ym(e.motion_preset_id);return{colorSeeds:e.color_seeds,surfaceMode:e.surface_mode,fonts:{heading:s.heading,body:s.body},density:e.density,motionLevel:i.motionLevel,motionPreset:i.id,radius:Sy(e),weightStyle:fy(e,n)}}function Aj(e,n){let s=e.theme.candidates[0];return{version:1,recommendation_id:e.id,theme_preset_id:s.id,color_seeds:s.color_seeds,surface_mode:s.surface_mode,font_pairing_id:e.font.recommended_id,motion_preset_id:e.motion.recommended_id,density:e.density.recommended_id,radius:s.radius,weight_style:s.weight_style,updated_at:n.toISOString()}}import{z as to}from"zod";function by(e){return JSON.stringify([e.color_seeds.primary.toUpperCase(),e.color_seeds.accent.toUpperCase(),e.color_seeds.foreground.toUpperCase(),e.surface_mode,e.font_pairing_id,e.radius,e.motion_preset_id,e.density,e.weight_style])}var yy=to.object(eo.shape).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,a)=>{let o=by(i);s.has(o)&&n.addIssue({code:"custom",path:["theme_candidates",a],message:"Theme candidates must have pairwise distinct visual identities"}),s.add(o)})}),vj=to.union([eo,yy.safeExtend({model_profile:to.literal("azure-gpt")})]);import{z as Ot}from"zod";var jj=Ot.object({site_id:k,site_language:Ot.string().trim().min(2).max(35),business_facts:Ot.array(Ot.string().trim().min(1).max(1e3)).min(1).max(8)}).strict(),xy=Ot.enum(["high","medium","low"]),Lj=Ot.object({skill_name:Ot.string().trim().min(1).max(80).nullable(),confidence:xy,reason:Ot.string().trim().min(1).max(240)}).strict();import{z as as}from"zod";var il=1e4,Ey=as.object({note:as.string().trim().max(il),updated_at:as.string().min(1)}).strict(),Gj=as.object({note:as.string().trim().max(il)}).strict(),qj=U(Ey.nullable());import{z as ae}from"zod";var no=["title","text","richtext","number","boolean","date","datetime","url","email","color","select","multiselect","tag"],ai=ae.object({name:ae.string().min(1).max(100),type:ae.enum(no),label:ae.string().min(1).max(255),required:ae.boolean().optional(),options:ae.array(ae.string()).optional()}),Kj=ae.object({name:ae.string(),cms_type:ae.string(),label:ae.string().optional(),required:ae.boolean().optional(),value_shape:ae.string().optional(),front_display:ae.enum(["visible","internal","forbidden"]).optional(),choices:ae.array(ae.object({value:ae.union([ae.string(),ae.number()]),label:ae.string()})).optional()}),zj=ae.object({route_file_path:ae.string().min(1),target_component_path:ae.string().min(1),content_type_hint:ae.string().min(1),collection_purpose:ae.enum(["generic","product"]).optional(),required_fields:ae.array(ai).optional(),mode:ae.enum(["bind_existing","provision"]),list_mode:ae.enum(["page","embedded"]).optional(),fields:ae.array(ai).optional(),seed_records:ae.array(ae.record(ae.string(),ae.unknown())).optional()});import{z as q}from"zod";var os=q.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),oi=q.string().regex(/^[a-f0-9]{64}$/),ri=q.string().regex(/^[a-z][a-z0-9-]{0,99}$/),ci=q.string().regex(/^[a-z0-9]{1,30}$/),Xe=e=>q.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),al=q.object({id:q.string().uuid(),key:Xe(100),name:Xe(255)}).strict(),rl=new Set(["title","summary","description","category","thumbnail","url","admin_id"]),Ry=new Set(["title","summary","description","image_query"]),Iy=new Set(["category","thumbnail","url","admin_id","page","pages","route","path","component","components","snapshot","run","site_id","cms_site_id","tenant_id","token","secret","password","authorization","headers","__proto__","prototype","constructor"]),ol=new Set(["select","multiselect"]),Ty=new Set(["title","text","richtext","date","datetime","url","email","color"]),ky=q.object({name:Xe(100),label:Xe(255),type:q.enum(no),required:q.boolean().optional(),options:q.array(Xe(100)).max(100).optional()}).strict().superRefine((e,n)=>{let s=e.options??[];ol.has(e.type)&&s.length===0&&n.addIssue({code:"custom",path:["options"],message:"Choice fields require at least one option"}),!ol.has(e.type)&&s.length>0&&n.addIssue({code:"custom",path:["options"],message:"Only choice fields may declare options"}),new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["options"],message:"Field options must be unique"}),rl.has(e.name)&&n.addIssue({code:"custom",path:["name"],message:"Reserved CMS field names cannot be declared"})}),Ay=q.array(ky).min(1).max(200),wy=q.array(q.record(q.string(),q.unknown())).max(1e3);function Ye(e,n,s){e.addIssue({code:"custom",path:n,message:s})}var Py=q.object({name:Xe(30),slug:ci,collection_purpose:q.enum(["generic","product"]).optional(),fields:Ay,seed_records:wy}).strict().superRefine((e,n)=>{let s=e.fields.map(a=>a.name);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["fields"],message:"Field names must be unique"}),s.some(a=>!rl.has(a))||n.addIssue({code:"custom",path:["fields"],message:"At least one custom field is required"});let i=new Map(e.fields.map(a=>[a.name,a]));e.seed_records.forEach((a,o)=>{for(let[c,r]of Object.entries(a)){let m=["seed_records",o,c];if(Iy.has(c)){Ye(n,m,"Seed cannot write reserved or runtime-owned fields");continue}if(c==="image_query"){(typeof r!="string"||r.trim()==="")&&Ye(n,m,"image_query must be a non-empty string");continue}if(Ry.has(c)){typeof r!="string"&&Ye(n,m,"Seed skeleton text fields must be strings");continue}let x=i.get(c);if(!x){Ye(n,m,"Seed contains an undeclared field");continue}if(r==null){Ye(n,m,"Seed field values must not be null");continue}if(x.type==="select")(typeof r!="string"||!(x.options??[]).includes(r))&&Ye(n,m,"Seed select value must be one of the declared options");else if(x.type==="multiselect")(!Array.isArray(r)||r.length===0||r.some(_=>typeof _!="string"||!(x.options??[]).includes(_)))&&Ye(n,m,"Seed multiselect value must contain only declared options");else if(x.type==="number")(typeof r!="number"||!Number.isFinite(r))&&Ye(n,m,"Seed number values must be finite numbers");else if(x.type==="boolean")typeof r!="boolean"&&Ye(n,m,"Seed boolean values must be booleans");else if(x.type==="tag"){let _=Array.isArray(r)?r:[r];(_.length===0||_.some(P=>typeof P!="string"||P.trim()===""))&&Ye(n,m,"Seed tag values must be non-empty strings")}else Ty.has(x.type)&&typeof r!="string"&&Ye(n,m,"Seed text-like values must be strings")}for(let c of e.fields)c.required&&!(c.name in a)&&Ye(n,["seed_records",o,c.name],"Required fields must be present in every seed record")}),new TextEncoder().encode(JSON.stringify(e)).byteLength>1024*1024&&n.addIssue({code:"custom",path:[],message:"Application template must not exceed 1048576 UTF-8 bytes"})}),so=q.object({schema_version:q.literal(1),application:Py}).strict(),Cy=q.object({templateId:q.string().uuid(),stableKey:ri,resolvedVersion:os,digest:oi,template:so}).strict(),vy=Cy,Dy={alreadyCreated:"APPLICATION_ALREADY_CREATED",slugConflict:"APPLICATION_SLUG_CONFLICT",createInProgress:"APPLICATION_CREATE_IN_PROGRESS",cmsUnbound:"APPLICATION_CMS_UNBOUND",templateVersionUnavailable:"APPLICATION_TEMPLATE_VERSION_UNAVAILABLE",createFailed:"APPLICATION_CREATE_FAILED",createResultUnknown:"APPLICATION_CREATE_RESULT_UNKNOWN"},cl=q.enum(Object.values(Dy)),ml=q.object({category_status:q.enum(["succeeded","failed","not_attempted"]),seed_status:q.enum(["skipped","succeeded","partial","failed"]),requested_count:q.number().int().nonnegative(),written_count:q.number().int().nonnegative().nullable(),published_count:q.number().int().nonnegative().nullable(),errors:q.array(q.object({stage:q.enum(["category","seed","receipt"]),code:Xe(100)}).strict()).max(20)}).strict(),Oy=q.object({templateId:q.string().uuid(),stableKey:ri,title:Xe(200),description:q.string().max(1e3),thumbnailUrl:q.string().url().nullable(),resolvedVersion:os,digest:oi,application:q.object({name:Xe(30),slug:ci}).strict(),categories:q.array(al),tags:q.array(al),status:q.enum(["available","creating","created","conflict","failed"]),errorCode:cl.nullable().optional(),template:so.optional()}).strict(),ll=q.object({items:q.array(Oy)}).strict(),Yj=q.object({version:os}).strict(),Ny=q.object({app_slug:ci,name:Xe(30),template:q.object({stable_key:ri,version:os,digest:oi}).strict()}).strict(),jy=q.object({status:q.literal("created"),application:Ny,initialization:ml}).strict(),Xj=jy,Ly=q.object({stable_key:ri,version:os,digest:oi,created_at:q.string().datetime().nullable(),initialization:ml.nullable()}).strict(),My=q.object({app_slug:ci,name:Xe(30),collection_slug:q.string().min(1),detail_prefix:q.string().min(1).optional(),source:Ly.nullable()}).strict(),Qj=q.object({applications:q.array(My)}).strict(),Zj=ll,Jj=q.object({code:cl,message:Xe(500)}).strict(),eL=so,tL=vy,nL=ll;import{z as ge}from"zod";var pl=e=>ge.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),Uy=ai.strict(),ul=ge.array(Uy).min(1).max(200),Fy=ge.array(ge.record(ge.string(),ge.unknown())).max(1e3),Gy=ge.string().regex(/^[a-z0-9]{1,30}$/),io=ge.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),oL=ge.object({name:pl(30),slug:pl(50),collection_purpose:ge.enum(["generic","product"]).optional(),fields:ul}).strict(),dl=ge.object({collection_slug:Gy,detail_prefix:ge.string().min(1).max(255),plugin_id:io.optional()}).strict(),rL=ge.discriminatedUnion("kind",[dl.extend({kind:ge.literal("created")}),dl.extend({kind:ge.literal("exists")})]),cL=ge.object({fields:ul,seed_records:Fy,category_id:io}).strict(),qy=ge.record(ge.string().min(1),ge.string().min(1).nullable()),mL=ge.object({ids:ge.array(io).max(1e3),urls:qy,failed:ge.array(ge.unknown()).max(1e3)}).strict();function lL(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,30)}import{z as Re}from"zod";import{z as ao}from"zod";var _l=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],gl="-",Wy="embedded",oo=ao.enum([..._l,gl]),By=ao.literal(Wy),ro=ao.object({scene:oo,shape:By}).strict();function uL(e){return _l.find(n=>n===e)??gl}var mi=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number","file"],Ky=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number"],zy=Re.object({name:Re.string().min(1).max(100),type:Re.enum(Ky),label:Re.string().min(1).max(255),required:Re.boolean().optional(),options:Re.array(Re.string()).optional()}),Hy=Re.string().regex(/^[a-z][a-z0-9-]{0,48}$/).optional(),SL=Re.object({mode:Re.enum(["bind_existing","provision"],{error:'mode is required. Use "bind_existing" or "provision". Never call connect_form with {}.'}),form_hint:Re.string().min(1).optional(),name:Re.string().min(1).max(255).optional(),scene:oo.optional(),component_slug:Hy,description:Re.string().min(1).max(1e3).optional(),fields:Re.array(zy).optional()}).superRefine((e,n)=>{e.mode==="provision"&&e.scene===void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is required for provision"}),e.mode==="bind_existing"&&e.scene!==void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is prohibited for bind_existing"}),e.mode==="bind_existing"&&!e.form_hint?.trim()&&n.addIssue({code:"custom",path:["form_hint"],message:"form_hint is required for bind_existing"}),e.mode==="provision"&&!e.name?.trim()&&n.addIssue({code:"custom",path:["name"],message:"name is required for provision"})}),fL=Re.object({name:Re.string(),label:Re.string(),cms_type:Re.string(),required:Re.boolean()});import{z as d}from"zod";var rs=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,Sn=/^[A-Za-z][A-Za-z0-9_-]{0,127}$/,li=/^[A-Za-z][A-Za-z0-9_]{0,99}$/,bl=/^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/,mo=/^[a-z][a-z0-9-]{0,99}$/,yl=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/,hl=2,Sl=3,pi=d.string().regex(rs),$y=d.string().regex(rs),lo=d.string().regex(rs),cs=d.string().regex(li),po=d.string().regex(bl),Vy=d.discriminatedUnion("status",[d.object({status:d.literal("unbound"),form_code:d.null()}).strict(),d.object({status:d.literal("bound"),form_code:d.string().regex(Sn)}).strict(),d.object({status:d.literal("missing"),form_code:d.string().regex(Sn)}).strict()]),Yy=d.object({value:po,label:d.string().trim().min(1).max(255)}).strict(),Xy=d.object({kind:d.literal("field"),field_name:cs,type:d.enum(mi),label:d.string().trim().min(1).max(255),required:d.boolean(),span:d.enum(["full","half"]),options:d.array(Yy).max(100),max_files:d.number().int().min(1).max(5).optional()}).strict(),Qy=d.object({kind:d.literal("step-break"),step_id:d.string().regex(rs)}).strict(),Zy=d.discriminatedUnion("kind",[Xy,Qy]),Jy=d.object({field_name:cs,type:d.enum(mi),last_label:d.string().max(255)}).strict(),ex=d.object({field_name:cs,value:po,last_label:d.string().max(255)}).strict(),tx=d.discriminatedUnion("kind",[d.object({kind:d.literal("custom")}).strict(),d.object({kind:d.literal("template"),slug:d.string().regex(mo),version:d.string().regex(yl)}).strict()]),nx={select:2,radio:2,multiselect:1,DropdownSelection:2,RadioButton:2,Checkbox:1};function lt(e){return e.toLowerCase()}function xl(e,n){return e.trim().toLocaleLowerCase(n)}function hn(e,n){return`${lt(e)}\0${n}`}function Ae(e,n,s,i){let a=new Set;for(let o of e){if(a.has(o)){i.addIssue({code:"custom",path:n,message:s});return}a.add(o)}}function uo(e,n,s,i){let a=nx[e]??0;a>0&&n<a?i.addIssue({code:"custom",path:s,message:`choice field requires at least ${a} option${a===1?"":"s"}`}):a===0&&n>0&&i.addIssue({code:"custom",path:s,message:"non-choice fields must use an empty options array"})}var _o=d.object({schema_version:d.literal(1),min_runtime_version:d.number().int().positive(),form_definition_id:pi,binding:Vy,content_locale:Te,features:d.object({multistep:d.boolean()}).strict(),copy:d.object({title:d.string().max(255),description:d.string().max(1e3),submit_button:d.string().trim().min(1).max(100),success_message:d.string().trim().min(1).max(500),error_message:d.string().max(500)}).strict(),layout:d.object({columns:d.enum(["one","two"])}).strict(),nodes:d.array(Zy).min(1).max(200),source:tx,retired:d.object({fields:d.array(Jy).max(1e3),options:d.array(ex).max(5e3)}).strict(),compatibility:d.object({standardization_version:d.number().int().positive(),diagnostics:d.array(d.string().trim().min(1).max(500)).max(100)}).strict()}).strict().superRefine((e,n)=>{let s=e.nodes.flatMap((r,m)=>r.kind==="field"?[[m,r]]:[]),i=s.map(([,r])=>r);i.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"at least one field node is required"});let a=e.nodes.filter(r=>r.kind==="step-break");!e.features.multistep&&a.length>0&&n.addIssue({code:"custom",path:["nodes"],message:"step-break requires the multistep feature"}),e.features.multistep&&(e.min_runtime_version<hl&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`multistep requires runtime version ${hl}`}),a.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"multistep requires at least one step-break"}));for(let[r,m]of e.nodes.entries())m.kind==="step-break"&&(r===0||r===e.nodes.length-1||e.nodes[r-1]?.kind==="step-break"||e.nodes[r+1]?.kind==="step-break")&&n.addIssue({code:"custom",path:["nodes",r],message:"step-break must separate two non-empty steps"});Ae(a.map(r=>r.step_id),["nodes"],"step_id must be unique",n),Ae(i.map(r=>lt(r.field_name)),["nodes"],"field_name must be unique",n),Ae(e.retired.fields.map(r=>lt(r.field_name)),["retired","fields"],"retired field_name must be unique",n);let o=new Set(e.retired.fields.map(r=>lt(r.field_name)));for(let[r,m]of s)o.has(lt(m.field_name))&&n.addIssue({code:"custom",path:["nodes",r,"field_name"],message:"retired field_name cannot be reused"}),uo(m.type,m.options.length,["nodes",r,"options"],n),m.type==="file"?e.min_runtime_version<Sl&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`file fields require runtime version ${Sl}`}):m.max_files!==void 0&&n.addIssue({code:"custom",path:["nodes",r,"max_files"],message:"max_files is only valid for file fields"}),Ae(m.options.map(x=>x.value),["nodes",r,"options"],"option value must be unique within a field",n),Ae(m.options.map(x=>xl(x.label,e.content_locale)),["nodes",r,"options"],"option label must be unique within a field",n);Ae(e.retired.options.map(r=>hn(r.field_name,r.value)),["retired","options"],"retired option identity must be unique",n);let c=new Set(e.retired.options.map(r=>hn(r.field_name,r.value)));for(let[r,m]of s)for(let[x,_]of m.options.entries())c.has(hn(m.field_name,_.value))&&n.addIssue({code:"custom",path:["nodes",r,"options",x,"value"],message:"retired option value cannot be reused"})}),sx=["copy.title","copy.description","copy.submit_button","copy.success_message","copy.error_message","nodes.*.label","nodes.*.options.*.label"],ix=new Set(sx);function kL(e){let n=e.map(s=>typeof s=="number"||/^\d+$/.test(s)?"*":s).join(".");return ix.has(n)}function AL(e,n){let s=[],i=e.nodes.filter(r=>r.kind==="field"),a=new Map(n.nodes.filter(r=>r.kind==="field").map(r=>[lt(r.field_name),r])),o=new Map(n.retired.fields.map(r=>[lt(r.field_name),r])),c=new Map(n.retired.options.map(r=>[hn(r.field_name,r.value),r]));for(let r of i){let m=lt(r.field_name),x=a.get(m),_=o.get(m);x&&x.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),x&&x.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!x&&_&&_.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!x&&_&&_.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!x&&!o.has(m)&&s.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name});let P=new Set(x?.options.map(K=>K.value)??[]);for(let K of r.options){let H=c.get(hn(r.field_name,K.value));!P.has(K.value)&&H&&H.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!P.has(K.value)&&!H&&s.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:K.value})}}for(let r of e.retired.fields){let m=o.get(lt(r.field_name));m&&m.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m&&m.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),m||s.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name})}for(let r of e.retired.options){let m=c.get(hn(r.field_name,r.value));m&&m.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m||s.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:r.value})}return s}var ax=d.enum(Nn),Nt=d.object({english:d.string().max(1e3),translations:d.partialRecord(ax,d.string().max(1e3)).optional()}).strict(),ox=d.object({template_option_key:d.string().regex(bl),label:Nt}).strict(),rx=d.object({template_field_key:d.string().regex(li),type:d.enum(mi),label:Nt,required:d.boolean(),span:d.enum(["full","half"]),options:d.array(ox).max(100)}).strict(),cx=d.object({template_step_key:d.string().regex(li),after_field_key:d.string().regex(li)}).strict(),wL=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],PL=[1,1,1,1,1,1],El=d.string().regex(mo),mx=d.object({schema_version:d.literal(1),slug:El,template_slugs:d.array(d.string().regex(/^[a-z][a-z0-9-]{0,99}$/)).max(500).optional(),name:Nt,template_count:d.number().int().min(0).max(500)}).strict().superRefine((e,n)=>{e.name.english.trim()===""&&n.addIssue({code:"custom",path:["name","english"],message:"English category name is required"})}),lx=d.object({schema_version:d.literal(1),slug:d.string().regex(mo),version:d.string().regex(yl),category:El,copy:d.object({title:Nt,description:Nt,submit_button:Nt,success_message:Nt,error_message:Nt}).strict(),layout:d.object({columns:d.enum(["one","two"])}).strict(),fields:d.array(rx).min(1).max(200),step_breaks:d.array(cx).max(20).optional()}).strict().superRefine((e,n)=>{for(let o of["title","description","submit_button","success_message","error_message"])e.copy[o].english.trim()===""&&n.addIssue({code:"custom",path:["copy",o,"english"],message:"English baseline text is required"});Ae(e.fields.map(o=>o.template_field_key),["fields"],"template_field_key must be unique",n);let s=new Map(e.fields.map((o,c)=>[o.template_field_key,c])),i=e.step_breaks??[];Ae(i.map(o=>o.template_step_key),["step_breaks"],"template_step_key must be unique",n),Ae(i.map(o=>o.after_field_key),["step_breaks"],"step breaks must not share an anchor field",n);let a=-1;for(let[o,c]of i.entries()){let r=s.get(c.after_field_key);r===void 0||r>=e.fields.length-1?n.addIssue({code:"custom",path:["step_breaks",o,"after_field_key"],message:"step break must follow an existing non-final field"}):r<=a&&n.addIssue({code:"custom",path:["step_breaks",o,"after_field_key"],message:"step breaks must follow field order"}),a=r??a}e.fields.length+i.length>200&&n.addIssue({code:"custom",path:["step_breaks"],message:"template fields and step breaks must not exceed 200 nodes"});for(let[o,c]of e.fields.entries()){c.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",o,"label","english"],message:"English field label is required"}),uo(c.type,c.options.length,["fields",o,"options"],n),Ae(c.options.map(r=>r.template_option_key),["fields",o,"options"],"template_option_key must be unique within a field",n),Ae(c.options.map(r=>r.label.english.trim().toLowerCase()),["fields",o,"options"],"English option labels must be unique within a field",n);for(let[r,m]of c.options.entries())m.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",o,"options",r,"label","english"],message:"English option label is required"})}}),CL=d.object({schema_version:d.literal(1),visibility:d.enum(["internal","public"]),categories:d.array(mx).max(500),templates:d.array(lx).max(500)}).strict().superRefine((e,n)=>{let s=(a,o)=>{let c=Nn.filter(r=>!a.translations?.[r]?.trim());c.length>0&&n.addIssue({code:"custom",path:[...o,"translations"],message:`public template copy is missing locales: ${c.join(", ")}`})};Ae(e.categories.map(a=>a.slug),["categories"],"template category slug must be unique",n);let i=new Set(e.categories.map(a=>a.slug));for(let[a,o]of e.categories.entries()){let c=e.templates.filter(r=>o.template_slugs?o.template_slugs.includes(r.slug):r.category===o.slug).length;o.template_count!==c&&n.addIssue({code:"custom",path:["categories",a,"template_count"],message:"template_count must match catalog templates"})}Ae(e.templates.map(a=>a.slug),["templates"],"template slug must be unique",n);for(let[a,o]of e.templates.entries())(e.categories.some(r=>r.template_slugs!==void 0)?!e.categories.some(r=>r.template_slugs?.includes(o.slug)):!i.has(o.category))&&n.addIssue({code:"custom",path:["templates",a,"category"],message:"template category must exist in catalog categories"});for(let[a,o]of e.categories.entries())if(o.template_slugs){Ae(o.template_slugs,["categories",a,"template_slugs"],"template membership must be unique",n);for(let c of o.template_slugs)e.templates.some(r=>r.slug===c)||n.addIssue({code:"custom",path:["categories",a,"template_slugs"],message:"template membership must exist in catalog templates"})}if(e.visibility==="public"){for(let[a,o]of e.categories.entries())s(o.name,["categories",a,"name"]);for(let[a,o]of e.templates.entries()){for(let[c,r]of Object.entries(o.copy))s(r,["templates",a,"copy",c]);for(let[c,r]of o.fields.entries()){s(r.label,["templates",a,"fields",c,"label"]);for(let[m,x]of r.options.entries())s(x.label,["templates",a,"fields",c,"options",m,"label"])}}}});function vL(e,n){let s=Dr(n),i=s?e.translations?.[s]:void 0;return i!==void 0&&i.trim()!==""?i:e.english}var px=["Text","Summary","Email","Phone","DropdownSelection","RadioButton","Checkbox","Boolean","Date","Num","MultipleFile","SpecificFile"],dx={text:"Text",textarea:"Summary",email:"Email",phone:"Phone",select:"DropdownSelection",radio:"RadioButton",multiselect:"Checkbox",boolean:"Boolean",date:"Date",number:"Num",file:"MultipleFile"},ux=d.object({value:po,label:d.string().trim().min(1).max(255)}).strict(),_x=d.object({field_name:cs,field_type:d.enum(px),field_label:d.string().trim().min(1).max(255),is_required:d.boolean(),sort_order:d.number().int().nonnegative(),options:d.array(ux).max(100)}).strict(),Rl=d.object({version:d.literal(1),locale:Te,fields:d.array(_x).min(1).max(200)}).strict().superRefine((e,n)=>{Ae(e.fields.map(s=>lt(s.field_name)),["fields"],"field_name must be unique",n);for(let[s,i]of e.fields.entries())uo(i.field_type,i.options.length,["fields",s,"options"],n),Ae(i.options.map(a=>a.value),["fields",s,"options"],"option value must be unique within a field",n),Ae(i.options.map(a=>xl(a.label,e.locale)),["fields",s,"options"],"option label must be unique within a field",n)});function DL(e){let n=e.nodes.filter(s=>s.kind==="field").map((s,i)=>({field_name:s.field_name,field_type:s.type==="file"&&s.max_files===1?"SpecificFile":dx[s.type],field_label:s.label,is_required:s.required,sort_order:i,options:s.options.map(a=>({...a}))}));return Rl.parse({version:1,locale:e.content_locale,fields:n})}function OL(e){return{form_display:{columns:e.layout.columns},fields:e.nodes.filter(n=>n.kind==="field").map(n=>({field_name:n.field_name,span:n.span}))}}function NL(e,n){if(e.binding.form_code!==null&&e.binding.form_code!==n.form.form_code)return e;let s=new Map(n.fields.map(i=>[i.field_name,i.span]));return{...e,layout:{columns:n.form.config_basic?.form_display?.columns??e.layout.columns},nodes:e.nodes.map(i=>i.kind==="field"?{...i,span:s.get(i.field_name)??i.span}:i)}}var ue=d.string().regex(/^sha256:[0-9a-f]{64}$/),gx=d.union([Ie,d.enum(["app/api/forms/[code]/route.ts","hooks/use-cms-form-submit.ts","lib/cms/forms.ts","lib/cms/client.ts"])]),hx=d.object({path:gx,content_hash:ue.nullable()}).strict(),Sx=d.array(hx).min(1).max(500).superRefine((e,n)=>{Ae(e.map(s=>s.path),[],"affected file paths must be unique",n)}),go=d.object({grade:d.enum(["standard","A","B","C"]),required:d.boolean(),pending_confirmations:d.array(d.object({item_id:d.string().regex(rs),field_name:cs.optional(),kind:d.enum(["form_copy","layout","field_label","field_type","field_required","field_options"]),message:d.string().trim().min(1).max(500)}).strict().superRefine((e,n)=>{e.kind.startsWith("field_")&&!e.field_name&&n.addIssue({code:"custom",path:["field_name"],message:"field confirmation items require field_name"})})).max(200)}).strict().superRefine((e,n)=>{let s=e.grade==="standard";s===e.required&&n.addIssue({code:"custom",path:["required"],message:s?"standard forms do not require standardization confirmation":"legacy forms require standardization confirmation"}),e.grade==="C"&&e.pending_confirmations.length===0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"grade C requires at least one pending confirmation"}),e.grade!=="C"&&e.pending_confirmations.length>0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"only grade C can contain pending confirmations"})}),fx=d.object({site_id:k,form_definition_id:pi,base_snapshot_id:I,expected_form_spec_hash:ue,expected_cms_schema_hash:ue.nullable(),form_metadata:ro.nullable(),draft_form_spec_hash:ue,desired_cms_schema_hash:ue,affected_files_hash:ue,shared_reference_hash:ue,shared_reference_count:d.number().int().positive(),confirm_shared_update:d.boolean(),recreate_missing_binding:d.boolean(),standardization:go,confirm_standardization:d.boolean()}).strict(),Il=d.object({reference_hash:ue,page_count:d.number().int().positive(),block_count:d.number().int().positive()}).strict().refine(e=>e.page_count<=e.block_count,{message:"page_count cannot exceed block_count"}),jL=d.object({site_id:k,form_block_id:$y,base_snapshot_id:I,form_spec:_o,runtime_upgrade_required:d.boolean(),expected_form_spec_hash:ue,expected_cms_schema_hash:ue.nullable(),affected_files_hash:ue,shared_impact:Il,standardization:go}).strict(),bx=d.object({operation_id:lo,operation_fingerprint:ue,site_id:k,form_definition_id:pi,base_snapshot_id:I,expected_form_spec_hash:ue,expected_cms_schema_hash:ue.nullable(),form_metadata:ro.nullable(),draft_form_spec:_o,draft_form_spec_hash:ue,desired_cms_schema_hash:ue,affected_files_hash:ue,shared_impact:Il,confirm_shared_update:d.boolean(),recreate_missing_binding:d.boolean(),standardization:go,confirm_standardization:d.boolean()}).strict().superRefine((e,n)=>{e.form_definition_id!==e.draft_form_spec.form_definition_id&&n.addIssue({code:"custom",path:["form_definition_id"],message:"form_definition_id must match draft_form_spec"}),e.shared_impact.block_count>1&&!e.confirm_shared_update&&n.addIssue({code:"custom",path:["confirm_shared_update"],message:"shared definition updates require explicit confirmation"});let s=e.draft_form_spec.binding.status==="missing";s!==e.recreate_missing_binding&&n.addIssue({code:"custom",path:["recreate_missing_binding"],message:s?"missing bindings require explicit recreation confirmation":"only missing bindings can be recreated"});let i=e.draft_form_spec.binding.status==="bound",a=i&&e.standardization.required&&(e.standardization.grade==="B"||e.standardization.grade==="C");(i&&!a&&e.expected_cms_schema_hash===null||!i&&e.expected_cms_schema_hash!==null)&&n.addIssue({code:"custom",path:["expected_cms_schema_hash"],message:i?"bound standard forms require the current CMS schema hash":"unbound or missing forms cannot claim a current CMS schema hash"}),e.confirm_standardization!==e.standardization.required&&n.addIssue({code:"custom",path:["confirm_standardization"],message:e.standardization.required?"legacy standardization requires explicit confirmation":"standard forms cannot claim legacy standardization confirmation"})}),yx=["created","validated","binding_reserved","candidate_ready","cms_applied","snapshot_promoted","committed","compensating","recovery_required","failed"],ho=d.enum(yx),xx=["pending","running","succeeded","failed","recovery_required"],Tl=d.enum(xx),Ex=["candidate_abandon","snapshot_reconcile","cms_restore"],kl=d.enum(Ex),Rx=["FORM_DESIGN_INVALID","FORM_DESIGN_UNSUPPORTED","FORM_DESIGN_STANDARDIZATION_AGENT_REQUIRED","FORM_DESIGN_STANDARDIZATION_UNSUPPORTED","FORM_DESIGN_FEATURE_NOT_ENABLED","FORM_DESIGN_PERMISSION_DENIED","FORM_DESIGN_LOCKED","FORM_DESIGN_CODE_CONFLICT","FORM_DESIGN_CMS_CONFLICT","FORM_DESIGN_CMS_SCHEMA_MISMATCH","FORM_DESIGN_CMS_NOT_FOUND","FORM_DESIGN_BINDING_MISSING","FORM_DESIGN_OPERATION_CONFLICT","FORM_DESIGN_CMS_UNAVAILABLE","FORM_DESIGN_PATCH_FAILED","FORM_DESIGN_COMPENSATION_FAILED","FORM_DESIGN_RECOVERY_REQUIRED"],So=d.enum(Rx),Al=d.enum(["wait","resume","retry_new_operation","manual_recovery","none"]),wl=d.enum(["not_started","pending","succeeded","failed"]),Pl=d.object({operation_id:lo,operation_fingerprint:ue,site_id:k,form_definition_id:pi,stage:ho,status:Tl,base_snapshot_id:I,candidate_snapshot_id:I.nullable(),before_form_code:d.string().regex(Sn).nullable(),materialized_form_code:d.string().regex(Sn).nullable(),expected_form_spec_hash:ue,draft_form_spec_hash:ue,materialized_form_spec_hash:ue.nullable(),expected_cms_schema_hash:ue.nullable(),desired_cms_schema_hash:ue,retry_count:d.number().int().nonnegative(),failure_stage:kl.nullable(),last_error_code:So.nullable(),retryable:d.boolean(),next_action:Al,preview_refresh_status:wl,created_at:d.string().datetime({offset:!0}),updated_at:d.string().datetime({offset:!0})}).strict().superRefine((e,n)=>{if(!(e.stage!=="committed"&&e.status!=="succeeded")){(e.stage!=="committed"||e.status!=="succeeded")&&n.addIssue({code:"custom",path:["status"],message:"committed stage and succeeded status must be reported together"});for(let s of["candidate_snapshot_id","materialized_form_code","materialized_form_spec_hash"])e[s]===null&&n.addIssue({code:"custom",path:[s],message:`${s} is required for a committed success`});(e.failure_stage!==null||e.last_error_code!==null||e.retryable||e.next_action!=="none")&&n.addIssue({code:"custom",path:["next_action"],message:"a committed success cannot retain an error or retry action"})}}),fo=d.object({operation:Pl}).strict(),LL=fo,ML=fo,UL=d.object({operation_fingerprint:ue}).strict(),FL=fo,Ix=d.preprocess(e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let n="form_metadata"in e?e:{...e,form_metadata:null};return"standardization"in e||"confirm_standardization"in e?n:{...n,standardization:{grade:"standard",required:!1,pending_confirmations:[]},confirm_standardization:!1}},bx),GL=d.object({operation:Pl,request:Ix,cms_replace_result:d.unknown().nullable()}).strict(),Tx=d.object({stage:ho.optional(),status:Tl.optional(),candidate_snapshot_id:I.nullable().optional(),before_form_code:d.string().regex(Sn).nullable().optional(),materialized_form_code:d.string().regex(Sn).nullable().optional(),materialized_form_spec_hash:ue.nullable().optional(),retry_count:d.number().int().nonnegative().optional(),failure_stage:kl.nullable().optional(),last_error_code:So.nullable().optional(),retryable:d.boolean().optional(),next_action:Al.optional(),preview_refresh_status:wl.optional()}).strict(),qL=d.object({expected_updated_at:d.string().datetime({offset:!0}),operation:Tx,cms_replace_result:d.unknown().nullable().optional()}).strict().refine(e=>Object.keys(e.operation).length>0||Object.hasOwn(e,"cms_replace_result"),{message:"transition must change operation state or CMS result"}),WL=d.object({code:So,message:d.string().trim().min(1).max(500),retryable:d.boolean(),operation_id:lo.optional(),stage:ho.optional()}).strict();function kx(e){return fx.parse({site_id:e.site_id,form_definition_id:e.form_definition_id,base_snapshot_id:e.base_snapshot_id,expected_form_spec_hash:e.expected_form_spec_hash,expected_cms_schema_hash:e.expected_cms_schema_hash,draft_form_spec_hash:e.draft_form_spec_hash,desired_cms_schema_hash:e.desired_cms_schema_hash,affected_files_hash:e.affected_files_hash,form_metadata:e.form_metadata,shared_reference_hash:e.shared_impact.reference_hash,shared_reference_count:e.shared_impact.block_count,confirm_shared_update:e.confirm_shared_update,recreate_missing_binding:e.recreate_missing_binding,standardization:e.standardization,confirm_standardization:e.confirm_standardization})}function fl(e){for(let n=0;n<e.length;n+=1){let s=e.charCodeAt(n);if(s>=55296&&s<=56319){let i=e.charCodeAt(n+1);if(n+1>=e.length||i<56320||i>57343)throw new TypeError("canonical JSON cannot contain a lone surrogate");n+=1}else if(s>=56320&&s<=57343)throw new TypeError("canonical JSON cannot contain a lone surrogate")}}function co(e,n){if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError("canonical JSON numbers must be finite");return JSON.stringify(e)}if(typeof e=="string")return fl(e),JSON.stringify(e);if(typeof e!="object")throw new TypeError("value is not valid JSON");if(n.has(e))throw new TypeError("canonical JSON cannot contain cycles");n.add(e);try{if(Array.isArray(e)){let o=[];for(let c=0;c<e.length;c+=1){if(!(c in e))throw new TypeError("canonical JSON cannot contain sparse arrays");o.push(co(e[c],n))}return`[${o.join(",")}]`}let s=Object.getPrototypeOf(e);if(s!==Object.prototype&&s!==null)throw new TypeError("canonical JSON objects must be plain records");let i=e;return`{${Object.keys(i).sort().map(o=>(fl(o),`${JSON.stringify(o)}:${co(i[o],n)}`)).join(",")}}`}finally{n.delete(e)}}function bo(e){return co(e,new Set)}async function di(e){let n=bo(e),s=new TextEncoder().encode(n),i=globalThis.crypto?.subtle?new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",s)):(await import("@noble/hashes/sha256")).sha256(s);return`sha256:${Array.from(i,o=>o.toString(16).padStart(2,"0")).join("")}`}async function BL(e){return di(_o.parse(e))}async function KL(e){return di(Rl.parse(e))}async function zL(e){let n=Sx.parse(e).map(s=>({...s})).sort((s,i)=>s.path<i.path?-1:s.path>i.path?1:0);return di({version:1,files:n})}async function HL(e){return di(kx(e))}import{z as D}from"zod";var YL=["page-seo","root-layout-metadata","nav-items"],XL=D.object({path:D.string(),title:D.string(),description:D.string().optional(),keywords:D.string().optional(),meta_tags_json:D.record(D.string(),D.record(D.string(),D.string())).nullish(),schema_json:D.union([D.record(D.string(),D.unknown()),D.array(D.record(D.string(),D.unknown())),D.string()]).nullish(),breadcrumbs_json:D.array(D.object({name:D.string().optional(),text:D.string().optional(),url:D.string().nullish()})).nullish()}),QL=D.object({metadataBase:D.string().optional(),title:D.union([D.string(),D.object({default:D.string().optional(),template:D.string().optional(),absolute:D.string().optional()})]).optional(),description:D.string().optional(),keywords:D.string().optional(),openGraph:D.object({title:D.string().optional(),description:D.string().optional(),type:D.string().optional(),siteName:D.string().optional(),url:D.string().optional(),locale:D.string().optional(),images:D.array(D.union([D.string(),D.object({url:D.string(),alt:D.string().optional()})])).optional()}).optional(),twitter:D.object({card:D.string().optional(),title:D.string().optional(),description:D.string().optional(),images:D.array(D.string()).optional()}).optional(),alternates:D.object({canonical:D.string().optional()}).optional(),robots:D.union([D.string(),D.record(D.string(),D.unknown())]).optional()}),Cl=()=>D.object({label:D.string(),href:D.string().optional(),targetType:D.enum(["page","anchor","external","email","phone","file","group"]).optional(),role:D.enum(["link","cta"]).optional(),openInNewTab:D.boolean().optional(),nofollow:D.boolean().optional(),description:D.string().optional(),badge:D.string().optional(),iconKey:D.string().optional()}),ZL=Cl().extend({children:D.array(Cl()).optional()}),Ax=["title","description","keywords","breadcrumbs_json.*.name","breadcrumbs_json.*.text"],wx=["path","meta_tags_json.**","schema_json.**","breadcrumbs_json.*.url"],Px=["title","title.default","title.template","title.absolute","description","keywords","openGraph.title","openGraph.description","openGraph.siteName","openGraph.images.*.alt","twitter.title","twitter.description"],Cx=["metadataBase","openGraph.type","openGraph.url","openGraph.locale","openGraph.images.*","openGraph.images.*.url","twitter.card","twitter.images.*","alternates.canonical","robots.**"],vx=["label","description","badge"],Dx=["href","targetType","role","iconKey"],vl={"page-seo":{localizable:Ax,machine:wx},"root-layout-metadata":{localizable:Px,machine:Cx},"nav-items":{localizable:vx,machine:Dx}},Dl="*",Ol="**",Ox="children";function Nx(e){return typeof e=="number"||/^\d+$/.test(e)?Dl:e}function Nl(e,n){let s=n.map(Nx);return e!=="nav-items"?s:s.filter(i=>i!==Dl&&i!==Ox)}function jl(e,n){let s=e.split(".");for(let i=0;i<s.length;i+=1){if(s[i]===Ol)return!0;if(i>=n.length||s[i]!==n[i])return!1}return s.length===n.length}function jx(e,n){let s=e.split(".");if(n.length>=s.length)return!1;for(let i=0;i<n.length;i+=1){if(s[i]===Ol)return!0;if(s[i]!==n[i])return!1}return!0}function JL(e,n){let s=Nl(e,n);return s.length===0?!1:vl[e].localizable.some(i=>jl(i,s))}function eM(e,n){let s=Nl(e,n);if(s.length===0)return!0;let{localizable:i,machine:a}=vl[e];return[...i,...a].some(o=>jl(o,s)||jx(o,s))}var sM=["product-search","migration-products","standard-form","form-submission-infrastructure"],Lx=[{path:"app/search/page.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/entry.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/results.tsx",materializer:"product-search"},{path:"app/api/product-search/facets/route.ts",materializer:"product-search"},{path:"lib/cms/product-search.ts",materializer:"product-search"},{path:"lib/generated/product-search-value-codec.ts",materializer:"product-search"},{path:"lib/generated/product-search-config.json",materializer:"product-search"},{path:`lib/cms/generated/${yt}.ts`,materializer:"migration-products"},{path:`components/site/generated/${yt}-list.tsx`,materializer:"migration-products"},{path:`app/${yt}/[slug]/page.tsx`,materializer:"migration-products"},{path:`components/site/generated/${yt}-breadcrumb.tsx`,materializer:"migration-products"},{path:"components/site/generated/forms/vcp-form-runtime.tsx",materializer:"standard-form"},{path:"app/api/forms/[code]/route.ts",materializer:"form-submission-infrastructure"},{path:"hooks/use-cms-form-submit.ts",materializer:"form-submission-infrastructure"},{path:"lib/cms/forms.ts",materializer:"form-submission-infrastructure"}],Mx=[{prefix:"components/site/generated/forms/form-",suffix:".tsx",materializer:"standard-form"}],iM=[{path:`components/site/generated/${yt}-list-view.tsx`,reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u4E13\u7528\u4EA7\u54C1 Worker \u6309\u7AD9\u70B9\u8BBE\u8BA1\u751F\u6210\u5217\u8868\u89C6\u56FE\uFF1B\u9996\u6B21 fallback \u4E0D\u6539\u53D8\u5F52\u5C5E\uFF0C\u9759\u6001\u6587\u6848\u987B\u968F\u5B50\u7AD9\u7FFB\u8BD1\u3002"},{path:`components/site/generated/${yt}-detail-view.tsx`,reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u4E13\u7528\u4EA7\u54C1 Worker \u6309\u7AD9\u70B9\u8BBE\u8BA1\u751F\u6210\u8BE6\u60C5\u89C6\u56FE\uFF1B\u9996\u6B21 fallback \u4E0D\u6539\u53D8\u5F52\u5C5E\uFF0C\u9759\u6001\u6587\u6848\u987B\u968F\u5B50\u7AD9\u7FFB\u8BD1\u3002"},{path:"lib/cms/client.ts",reason:"\u4E0D\u662F\u7269\u5316\u4EA7\u7269\uFF1A\u6A21\u677F\u81EA\u5E26\u7684 CMS \u4F20\u8F93\u5C42\uFF0C\u7269\u5316\u5668\u53EA\u5BF9\u5B83\u505A\u5B9A\u70B9\u5B57\u7B26\u4E32\u5347\u7EA7\uFF08\u591A\u90E8\u5206\u8868\u5355\u63D0\u4EA4\u3001no-store \u8BFB\uFF09\uFF0C\u6574\u4EFD\u8986\u5199\u53CD\u800C\u4F1A\u62B9\u6389\u7AD9\u70B9\u4FA7\u7684\u5176\u4ED6\u5347\u7EA7\u3002"},{path:"components/site/generated/forms/form-<id>.spec.ts",reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u8868\u5355\u8BBE\u8BA1\u5668\u5199\u7684\u5B57\u6BB5\u6587\u6848\uFF0C\u5F52 FORM_SPEC_LOCALIZABLE_FIELD_PATHS \u7684\u5B57\u6BB5\u7EA7\u6E05\u5355\u7BA1\u8F96\u3002"},{path:"components/system/not-found-content.tsx",reason:"\u4E00\u6B21\u6027\u5199\u5165\u3001\u4E4B\u540E\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u5EFA\u7AD9\u65F6\u4EC5\u5728\u6A21\u677F\u539F\u7248\u4E0A\u6309\u7AD9\u70B9\u8BED\u79CD\u5199\u4E00\u6B21 404 \u6587\u6848\uFF0C\u4E4B\u540E\u7531\u7528\u6237\u3001\u8BBE\u8BA1\u5668\u6216 Agent \u7EF4\u62A4\uFF0C\u91CD\u8DD1\u4E5F\u4E0D\u4F1A\u8986\u5199\u6539\u8FC7\u7684\u5185\u5BB9\uFF1B\u5B50\u7AD9\u987B\u968F\u6574\u7AD9\u7FFB\u8BD1\u5B83\u3002"}];function Ux(e){return e.length>0&&!e.includes("/")&&!e.includes(".")}function aM(e){return Lx.some(n=>n.path===e)?!0:Mx.some(n=>!e.startsWith(n.prefix)||!e.endsWith(n.suffix)?!1:Ux(e.slice(n.prefix.length,e.length-n.suffix.length)))}import{z as Et}from"zod";var Fx=["provisioning","cms_app_created","seeded","ready","failed"],mM=Et.object({tenant_id:Et.string().min(1),site_id:k,collection_slug:Et.string().min(1),cms_collection_id:Et.string().min(1).nullable(),status:Et.enum(Fx),owned_by_vcp:Et.boolean(),run_id:V.nullable(),last_error:Et.string().nullable(),created_at:Et.string().datetime(),updated_at:Et.string().datetime()});var Ll="/vibe/v1";function Gx(e){let n=e?.trim().replace(/\/+$/,"");if(!n)return null;try{let s=new URL(n),i=s.pathname.replace(/\/+$/,"");return s.search="",s.hash="",s.pathname=i.endsWith(Ll)?i:Ll,s.href.replace(/\/+$/,"")}catch{return n}}function pM(e){let n=Gx(e.publicProxyUrl),s=e.cmsSiteId?.trim(),i=e.tenantId?.trim();return n&&s&&i?{cmsProxyUrl:n,cmsProjectId:s,cmsTenantId:i}:null}function uM(e){let n=e.tenant_id?.trim(),s=e.cms_site_id?.trim();if(!n||!s)throw new Error("CMS_REQUEST_CONTEXT_MISSING");return{Accept:"application/json","X-Tenant-Id":n,"X-Site-Id":s}}import{z as g}from"zod";var ui=g.string().url().refine(oE,{message:"URL must use http or https"}),Ml=g.string().trim().pipe(ui),qx=g.object({task_type:g.literal("home_url"),task_url:Ml,planned_num:g.number().int().min(1).max(20).optional()}).strict(),Wx=g.object({task_type:g.literal("url_list"),urls:g.array(ui).min(1).max(1e4)}).strict(),SM=g.discriminatedUnion("task_type",[qx,Wx]),fM=g.object({page:g.coerce.number().int().positive().default(1),page_size:g.coerce.number().int().min(1).max(20).default(20)}).strict(),bM=g.object({home_url:Ml}).strict(),Yt=g.string().uuid(),fn=g.string().uuid(),yM=g.object({task_uuid:Yt}).strict(),Ul=g.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]),Bx=g.object({task_uuid:Yt,status:g.literal("NOT_STARTED"),total:g.literal(0)}).strict(),Kx=g.object({task_uuid:Yt,status:g.literal("PROCESSING"),total:g.literal(0)}).strict(),xM=g.enum(["no_suitable_page_candidate","page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"]),zx=g.discriminatedUnion("status",[g.object({role:wt,status:g.literal("selected"),reason_code:g.null()}).strict(),g.object({role:wt,status:g.literal("not_found"),reason_code:g.literal("no_suitable_page_candidate")}).strict(),g.object({role:wt,status:g.literal("unknown"),reason_code:g.enum(["page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"])}).strict()]),Fl=g.array(zx).length(7).superRefine((e,n)=>{let s=new Set(e.map(i=>i.role));s.size!==e.length&&n.addIssue({code:"custom",message:"discovery coverage roles must be unique"});for(let i of wt.options)s.has(i)||n.addIssue({code:"custom",message:`discovery coverage is missing role ${i}`})}),Hx=g.object({task_uuid:Yt,status:g.literal("SUCCEEDED"),total:g.number().int().positive(),discovery_coverage:Fl.optional()}).strict(),$x=g.enum(["TASK_FAILED","PROVIDER_CAPABILITY_LIMIT","WEBSITE_UNREACHABLE"]),Vx=g.object({task_uuid:Yt,status:g.literal("FAILED"),total:g.literal(0),error_code:$x,error_message:g.string().min(1),failure_stage:Ul}).strict(),EM=g.discriminatedUnion("status",[Bx,Kx,Hx,Vx]),Yx=g.object({url:ui,raw_html:g.string().min(1)}).strict(),RM=g.object({task_uuid:Yt,status:g.literal("SUCCEEDED"),page:g.number().int().positive(),page_size:g.number().int().min(1).max(20),total:g.number().int().positive(),total_pages:g.number().int().positive(),pages:g.array(Yx).max(20),discovery_coverage:Fl.optional()}).strict().superRefine((e,n)=>{e.total_pages!==Math.ceil(e.total/e.page_size)&&n.addIssue({code:"custom",path:["total_pages"],message:"total_pages must equal ceil(total / page_size)"}),e.pages.length>e.page_size&&n.addIssue({code:"custom",path:["pages"],message:"pages must not exceed page_size"})}),IM=g.object({task_code:fn}).strict(),Xx=g.object({task_code:fn,status:g.literal("NOT_STARTED")}).strict(),Qx=g.object({task_code:fn,status:g.literal("PROCESSING")}).strict(),Zx=g.object({task_code:fn,status:g.literal("SUCCEEDED"),urls:g.array(ui)}).strict(),Jx=g.literal("SITEMAP_DISCOVERY_FAILED"),eE=g.object({task_code:fn,status:g.literal("FAILED"),error_code:Jx,error_message:g.string().min(1)}).strict(),TM=g.discriminatedUnion("status",[Xx,Qx,Zx,eE]),kM=g.object({company_name:g.string().regex(/\S/u)}).strict(),tE=g.object({company_name:g.string(),brand_name:g.string(),main_products:g.array(g.string()),industry:g.array(g.string()),subfields:g.array(g.string()),business_intro:g.string(),registered_capital:g.string(),legal_representative:g.string(),target_markets:g.array(g.string()),target_customer_industries:g.array(g.string()),target_customer_roles:g.array(g.string()),purchase_scenarios:g.string(),differentiators:g.array(g.string()),competitors:g.array(g.object({name:g.string(),official_url:g.string()}).strict()).max(3),qualifications:g.array(g.string()),representative_cases:g.array(g.string()),acquisition_channels:g.array(g.string()),desired_domain:g.string(),brand_tone:g.string(),timezone:g.string()}).strict(),_i=g.object({company_uuid:g.string().uuid(),company_info:tE,created_at:g.string().datetime(),updated_at:g.string().datetime()}),nE=_i.extend({status:g.literal("NOT_STARTED"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.null(),completed_at:g.null()}).strict(),sE=_i.extend({status:g.literal("PROCESSING"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.string().datetime(),completed_at:g.null()}).strict(),Gl=_i.extend({status:g.literal("SUCCEEDED"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.string().datetime(),completed_at:g.string().datetime()}).strict(),ql=_i.extend({status:g.literal("FAILED"),last_error_code:g.string().min(1),last_error_message:g.string().min(1),started_at:g.string().datetime(),completed_at:g.string().datetime()}).strict(),AM=g.discriminatedUnion("status",[Gl,ql]),wM=g.discriminatedUnion("status",[nE,sE,Gl,ql]),iE=["BAD_REQUEST","NOT_FOUND","PAYLOAD_TOO_LARGE","INTERNAL_SERVER_ERROR","UNAUTHORIZED","FORBIDDEN","INVALID_TASK_TYPE","TASK_URL_REQUIRED","INVALID_PLANNED_NUM","URL_LIST_REQUIRED","URL_LIST_LIMIT_EXCEEDED","INVALID_URL_LIST","INVALID_PAGINATION","INVALID_TASK_CODE","INVALID_HOME_URL","TASK_CODE_HOME_URL_CONFLICT","SITEMAP_TASK_NOT_FOUND","SITEMAP_DISCOVERY_FAILED","TASK_NOT_FOUND","PROVIDER_CAPABILITY_LIMIT","TASK_FAILED","WEBSITE_UNREACHABLE"],aE=g.enum(iE),PM=g.object({error_code:aE,error_message:g.string().min(1),failure_stage:Ul.optional(),task_uuid:Yt.optional(),task_code:fn.optional()}).strict();function oE(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}import{z as B}from"zod";var Qe=B.string().url().refine(mE,{message:"URL must use http or https"}),Wl=B.string().min(1).max(512),gi=B.string().datetime({offset:!0}),Bl=B.enum(["scraping","completed","failed","expired"]),DM=B.object({url:Qe,ignore_cache:B.boolean(),sitemap:B.enum(["include","skip"]),include_subdomains:B.boolean(),ignore_query_parameters:B.boolean(),limit:B.number().int().min(1).max(1e5)}).strict(),OM=B.object({links:B.array(Qe).max(1e5)}).strict(),NM=B.object({url:Qe,limit:B.number().int().min(1).max(1e5),max_discovery_depth:B.literal(1),crawl_entire_domain:B.literal(!1),allow_subdomains:B.literal(!0),sitemap:B.literal("skip")}).strict(),jM=B.object({crawl_id:Wl,expires_at:gi.optional()}).strict(),LM=B.object({status:Bl,urls:B.array(Qe).max(1e5),next:Qe.optional(),expires_at:gi}).strict(),MM=B.object({url:Qe,formats:B.tuple([B.literal("rawHtml")]),only_main_content:B.literal(!1),max_age:B.number().int().nonnegative()}).strict(),UM=B.object({url:Qe,raw_html:B.string().min(1),status_code:B.number().int().min(100).max(599).nullable()}).strict(),FM=B.object({urls:B.array(Qe).min(1).max(1e4),formats:B.tuple([B.literal("rawHtml")]),ignore_invalid_urls:B.literal(!1),max_age:B.number().int().nonnegative(),max_concurrency:B.number().int().positive().optional()}).strict(),GM=B.object({batch_id:Wl,expires_at:gi.optional()}).strict(),rE=B.object({url:Qe,raw_html:B.string().min(1)}).strict(),qM=B.object({status:Bl,total:B.number().int().nonnegative(),completed:B.number().int().nonnegative(),pages:B.array(rE).max(1e4),next:Qe.optional(),expires_at:gi}).strict().superRefine((e,n)=>{e.completed>e.total&&n.addIssue({code:"custom",path:["completed"],message:"completed must not exceed total"})}),cE=B.object({url:Qe,error_message:B.string().min(1)}).strict(),WM=B.object({errors:B.array(cE).max(1e4),robots_blocked:B.array(Qe).max(1e4)}).strict(),BM=B.object({active:B.number().int().nonnegative(),waiting:B.number().int().nonnegative(),max_concurrency:B.number().int().positive()}).strict();function mE(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}var Kl=["write_file","edit_file","delete_file"],zl="apply_patch_batch",lE=["set_breadcrumb_placement"],pE=[...Kl,zl,...lE];function dE(e){return Kl.includes(e)}function zM(e){return pE.includes(e)}function HM(e){return dE(e)||e===zl}import{z as y}from"zod";var Hl=y.lazy(()=>bn),uE=y.enum(["page","block"]),Si=y.enum(["component","page","pages"]),_E=y.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),Xt=_E,$l=y.object({requested_locale:Xt,resolved_locale:Xt,fallback_used:y.boolean()}).strict(),ms=y.object({id:y.string().uuid(),key:y.string().min(1),name:y.string().min(1)}).strict(),hi=ms.extend({color:y.string().nullable()}).strict(),QM=y.object({kind:uE,category_id:y.string().uuid().optional(),tag_id:y.string().uuid().optional(),search:y.string().trim().min(1).max(200).optional(),limit:y.coerce.number().int().min(1).max(50).default(20),cursor:y.string().min(1).optional()}).strict(),gE=y.object({stable_key:y.string().min(1),type:Si,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnail_url:y.string().url().nullable(),resolved_version:y.number().int().positive(),content_schema_version:y.literal(3),category:ms.nullable(),tags:y.array(hi),page_count:y.number().int().nonnegative(),component_count:y.number().int().nonnegative(),locale:$l}).strict(),ZM=y.object({items:y.array(gE),facets:y.object({categories:y.array(ms),tags:y.array(hi)}).strict(),next_cursor:y.string().nullable()}).strict(),JM=y.object({operation_id:y.string().uuidv7(),resolved_version:y.number().int().positive(),base_sitemap_id:y.string().uuid(),base_sitemap_version:y.number().int().positive(),sitemap:Hl,target_page_id:y.string().min(1).optional()}).strict(),eU=y.object({next_sitemap:Hl,applied:y.object({stable_key:y.string().min(1),resolved_version:y.number().int().positive(),template_type:Si,page_ids:y.array(y.string().min(1)),block_ids:y.array(y.string().min(1))}).strict(),locale:$l,warnings:y.array(y.string())}).strict(),Vl=y.object({nodeId:y.string().uuid(),type:y.string().trim().min(1).max(100),label:y.string().trim().min(1).max(200),variant:y.string().trim().min(1).max(100).optional(),order:y.number().int().nonnegative(),props:y.record(y.string(),y.unknown()),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),Yl=y.object({nodeId:y.string().uuid().optional(),slug:y.string().regex(/^\/$|^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u),navigation:y.object({showInHeader:y.boolean(),showInFooter:y.boolean(),order:y.number().int().nonnegative()}).strict(),components:y.array(Vl).min(1).max(100),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),hE=Yl.extend({nodeId:y.uuidv7(),parentNodeId:y.uuidv7().optional()}).strict(),SE=y.object({pages:y.array(hE).min(1).max(50),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict().superRefine(({pages:e},n)=>{let s=new Map(e.map(a=>[a.nodeId,a])),i=e.flatMap(a=>[a.nodeId,...a.components.map(o=>o.nodeId)]);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["pages"],message:"Node ids must be unique within the shared structure."}),new Set(e.map(a=>a.slug)).size!==e.length&&n.addIssue({code:"custom",path:["pages"],message:"Page slugs must be unique."});for(let[a,o]of e.entries()){if(o.parentNodeId===void 0)continue;let c=_=>n.addIssue({code:"custom",path:["pages",a,"parentNodeId"],message:_}),r=s.get(o.parentNodeId);r||c("Parent must reference a page in this template."),o.parentNodeId===o.nodeId&&c("A page cannot be its own parent."),(o.slug==="/"||r?.slug==="/")&&c("The home page cannot be a parent or child."),r?.parentNodeId!==void 0&&c("Pages allow at most two levels; the parent must be a root page.");let m=new Set([o.nodeId]),x=o.parentNodeId;for(;x!==void 0;){if(m.has(x)){c("Page parent references must not contain a cycle.");break}m.add(x),x=s.get(x)?.parentNodeId}}}),fE=y.union([Vl,Yl,SE]),bE=y.object({title:y.string().min(1).max(200),description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192)}).strict(),yE=y.object({locale:Xt,title:y.string().min(1).max(200),content:y.object({description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192),nodes:y.record(y.string().uuid(),bE)}).strict()}).strict(),tU=y.object({templateId:y.string().uuid(),stableKey:y.string().min(1),type:Si,resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),structure:fE,requestedLocale:Xt,resolvedLocale:Xt,fallbackUsed:y.boolean(),contents:y.array(yE).length(1)}).strict().superRefine((e,n)=>{(e.type==="component"&&!("type"in e.structure)||e.type==="page"&&!("components"in e.structure)||e.type==="pages"&&!("pages"in e.structure))&&n.addIssue({code:"custom",path:["structure"],message:"Template type and structure must match."});let s=xE(e.structure),i=new Set(Object.keys(e.contents[0]?.content.nodes??{}));(s.size!==i.size||[...s].some(a=>!i.has(a)))&&n.addIssue({code:"custom",path:["contents",0,"content","nodes"],message:"Localized nodes must exactly match the structure nodes."}),e.contents[0]?.locale!==e.resolvedLocale&&n.addIssue({code:"custom",path:["contents"],message:"Resolved locale must match returned content."}),e.fallbackUsed!==(e.requestedLocale!==e.resolvedLocale)&&n.addIssue({code:"custom",path:["fallbackUsed"],message:"fallbackUsed must match locale resolution."})}),nU=y.object({items:y.array(y.object({stableKey:y.string().min(1),type:Si,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnailUrl:y.string().url().nullable(),resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),category:ms.nullable(),tags:y.array(hi),pageCount:y.number().int().nonnegative(),componentCount:y.number().int().nonnegative(),requestedLocale:Xt,resolvedLocale:Xt,fallbackUsed:y.boolean()}).strict()),facets:y.object({categories:y.array(ms),tags:y.array(hi)}).strict(),nextCursor:y.string().nullable()}).strict().superRefine((e,n)=>{e.items.forEach((s,i)=>{s.fallbackUsed!==(s.requestedLocale!==s.resolvedLocale)&&n.addIssue({code:"custom",path:["items",i,"fallbackUsed"],message:"fallbackUsed must match locale resolution."})})});function xE(e){if("type"in e)return new Set([e.nodeId]);let n="pages"in e?e.pages:[e];return new Set(n.flatMap(s=>[...s.nodeId?[s.nodeId]:[],...s.components.map(i=>i.nodeId)]))}function sU(e){return bo({tenant_id:e.tenant_id,site_id:e.site_id,stable_key:e.stable_key,resolved_version:e.request.resolved_version,base_sitemap_id:e.request.base_sitemap_id,base_sitemap_version:e.request.base_sitemap_version,sitemap:e.request.sitemap,target_page_id:e.request.target_page_id??null})}import{z as $}from"zod";var EE=["pending_dns","active","failed","removing"],RE=$.enum(EE),IE=["serve_site","redirect_301"],TE=$.enum(IE),kE=["traffic","ownership","certificate_delegation"],yo=$.enum(kE),AE=["pending","verified"],wE=$.enum(AE),PE=["not_applicable","unavailable","not_needed","auto_applied","confirmation_required","blocked"],CE=$.enum(PE),xo=$.enum(["prepare_configuration","apply_configuration","verify_dns","remediate_dns","confirm_dns_remediation"]),vE=$.enum(["accepted","running","succeeded","failed"]),DE=$.object({code:$.string().min(1),message:$.string().min(1)}).strict(),OE=$.object({purpose:yo,verified:$.boolean(),observedValues:$.array($.string())}).strict(),Xl=$.object({ready:$.boolean(),providerReady:$.boolean(),dnsVerified:$.boolean(),records:$.array(OE)}).strict(),Ql=$.object({type:$.string().min(1),name:$.string().min(1),value:$.string().min(1),ttl:$.number().nullable()}).strict(),NE=$.object({purpose:yo,action:$.enum(["none","create","update","blocked"]),before:Ql.nullable(),after:Ql.nullable()}).strict(),Zl=$.object({domainId:$.string().min(1),status:CE,changes:$.array(NE)}).strict(),jE=$.object({purpose:yo,type:$.string().min(1),name:$.string().min(1),value:$.string().min(1),verificationStatus:wE}).strict(),Jl=$.object({id:$.string().min(1),hostname:$.string().min(1),isPrimary:$.boolean(),routingMode:TE,observedStatus:RE,lastVerifiedAt:$.string().datetime().nullable(),dnsRecords:$.array(jE)}).strict().superRefine((e,n)=>{LE(e.hostname)||n.addIssue({code:"custom",path:["hostname"],message:"hostname must be a canonical ASCII hostname"}),e.isPrimary&&e.routingMode!=="serve_site"&&n.addIssue({code:"custom",path:["routingMode"],message:"a primary domain must serve the site"}),!e.isPrimary&&e.routingMode!=="redirect_301"&&n.addIssue({code:"custom",path:["routingMode"],message:"a non-primary domain must redirect with 301"})}),ep=$.object({primaryDomain:Jl.nullable(),redirectDomains:$.array(Jl)}).strict().superRefine((e,n)=>{e.primaryDomain!==null&&(!e.primaryDomain.isPrimary||e.primaryDomain.routingMode!=="serve_site")&&n.addIssue({code:"custom",path:["primaryDomain"],message:"primaryDomain must be primary and serve the site"});for(let[i,a]of e.redirectDomains.entries())(a.isPrimary||a.routingMode!=="redirect_301")&&n.addIssue({code:"custom",path:["redirectDomains",i],message:"redirectDomains must be non-primary 301 redirects"});e.primaryDomain!==null&&e.redirectDomains.some(a=>a.hostname===e.primaryDomain?.hostname)&&n.addIssue({code:"custom",path:["redirectDomains"],message:"primaryDomain must not also be a redirect"});let s=[...e.primaryDomain===null?[]:[e.primaryDomain.hostname],...e.redirectDomains.map(i=>i.hostname)];new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["redirectDomains"],message:"domain hostnames must be unique"})}),fi=$.object({id:$.string().min(1),type:xo,status:vE,error:DE.nullable(),result:$.union([Xl,Zl]).nullable().optional()}).strict().superRefine((e,n)=>{if(e.status==="failed"&&e.error===null&&n.addIssue({code:"custom",path:["error"],message:"failed operations must include a stable error"}),e.status!=="failed"&&e.error!==null&&n.addIssue({code:"custom",path:["error"],message:"non-failed operations must not include an error"}),!(e.result===void 0||e.result===null)){if(e.status!=="succeeded"){n.addIssue({code:"custom",path:["result"],message:"operation results only belong to succeeded operations"});return}if(e.type==="verify_dns"){Xl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"verify_dns operations require a DNS verification result"});return}if(e.type==="remediate_dns"){Zl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"remediate_dns operations require a DNS remediation result"});return}n.addIssue({code:"custom",path:["result"],message:"only verify_dns and remediate_dns operations may carry a result"})}});function LE(e){if(e!==e.trim()||e!==e.toLowerCase()||e.length>253||e.endsWith("."))return!1;let n=e.split(".");return n.length>=2&&n[n.length-1].length>=2&&n.every(s=>s.length>=1&&s.length<=63&&/^[a-z0-9-]+$/.test(s)&&!s.startsWith("-")&&!s.endsWith("-"))}import{z as Fe}from"zod";import{z as b}from"zod";var ME=b.enum(["active","completed","canceled"]),UE=b.enum(["quality","domain","gsc","publish"]),yi=b.enum(["pending","running","succeeded","failed"]),np=yi,sp=b.enum(["pending","running","completed"]),FE=b.object({group_code:b.string().min(1),name:b.string().min(1),score:b.number().nonnegative(),total_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),running_status:sp,result_text:b.string()}).strict(),GE=b.object({id:b.number().int().positive().optional(),quality_task_id:b.number().int().positive(),item_code:b.string().min(1),status:yi,is_repaired:b.boolean(),total_score:b.number().nonnegative(),score:b.number().nonnegative(),check_result:b.unknown().nullable(),remediation_items:b.unknown().nullable(),result_text:b.string(),created_at:b.string().min(1),updated_at:b.string().min(1),item_name:b.string().min(1),dimension_code:b.enum(["reach","trust","convert","safe"]),group_code:b.string().min(1),auto_fix:b.boolean()}).strict(),qE=b.object({dimension_code:b.enum(["reach","trust","convert","safe"]),name:b.string().min(1),alias_en:b.string().min(1),description:b.string(),tips:b.string(),score:b.number().nonnegative(),repaired_score:b.number().nonnegative(),total_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),running_status:sp,problem_group_count:b.number().int().nonnegative(),remediation_items:b.array(GE),groups:b.array(FE)}).strict(),WE=b.object({id:b.number().int().positive(),task_code:b.string().uuid(),scene_code:b.enum(["site_publish","vcp_published_pages","content_publish"]),tenant_id:b.string().min(1),vcp_site_id:k,cms_site_id:b.string().min(1),checked_url:b.string().url(),quality_params:b.record(b.string(),b.unknown()).nullable(),status:yi,error_info:b.record(b.string(),b.unknown()).nullable(),created_at:b.string().min(1),updated_at:b.string().min(1)}).strict(),BE=b.union([b.object({}).strict(),b.object({summary:b.object({final_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),group_count:b.number().int().nonnegative(),problem_group_count:b.number().int().nonnegative()}).strict(),dimensions:b.array(qE)}).strict()]),tp=b.object({quality_info:WE,quality_detail:BE}).strict().superRefine((e,n)=>{let s="summary"in e.quality_detail;e.quality_info.status!=="failed"&&!s&&n.addIssue({code:"custom",message:"nonfailed quality tasks require complete detail",path:["quality_detail"]}),e.quality_info.status==="failed"&&s&&n.addIssue({code:"custom",message:"failed quality tasks require empty detail",path:["quality_detail"]})}),dU=b.object({item_code:b.string().min(1),remediation_items:b.unknown().nullable()}).strict(),KE=b.object({item_code:b.string().min(1),repair_status:b.enum(["succeeded","failed"]),message:b.string().min(1).optional(),error_code:b.string().min(1).optional(),metadata:b.record(b.string(),b.unknown()).optional()}).strict(),ip=b.object({items:b.array(KE)}).strict(),uU=b.object({task_code:b.string().min(1),status:np,result:ip.optional()}).strict().superRefine((e,n)=>{e.status==="succeeded"&&e.result===void 0&&n.addIssue({code:"custom",path:["result"],message:"succeeded repair tasks require a complete result"}),(e.status==="pending"||e.status==="running")&&e.result!==void 0&&n.addIssue({code:"custom",path:["result"],message:"nonterminal repair tasks cannot expose a result"})}),jt=b.object({id:_s,tenant_id:b.string().min(1),site_id:k,status:ME,current_step:UE,quality_task_code:b.string().uuid().nullable(),quality_task_status:yi,repair_task_code:b.string().min(1).nullable(),repair_task_status:np,publish_deployment_id:dt.nullable(),domain_hostname:b.string().min(1).nullable(),domain_operation_type:xo.nullable(),domain_operation_payload:b.record(b.string(),b.unknown()).nullable(),domain_preparation_operation_id:b.string().min(1).nullable(),domain_operation_id:b.string().min(1).nullable(),revision:b.number().int().positive(),created_at:b.string().min(1),updated_at:b.string().min(1),completed_at:b.string().min(1).nullable(),canceled_at:b.string().min(1).nullable()}).strict().superRefine((e,n)=>{if(e.domain_operation_type===null){e.domain_operation_payload!==null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"domain_operation_payload must be null without an active domain operation"}),e.domain_operation_id!==null&&n.addIssue({code:"custom",path:["domain_operation_id"],message:"domain_operation_id must be null without an active domain operation"});return}e.domain_hostname===null&&n.addIssue({code:"custom",path:["domain_hostname"],message:"an active domain operation requires a hostname"}),e.domain_operation_payload===null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"an active domain operation requires a payload"})}),_U=b.object({}).strict(),gU=b.object({expected_revision:b.number().int().nonnegative(),current_step:b.enum(["domain","gsc","publish"]),skip_domain_binding:b.boolean().optional()}).strict(),hU=b.object({expected_revision:b.number().int().nonnegative()}).strict(),zE=b.object({workflow:jt.nullable(),can_cancel:b.boolean()}).strict(),SU=U(zE).strict(),HE=b.object({workflow:jt,can_cancel:b.boolean()}).strict(),fU=U(HE).strict(),$E=b.object({workflow:jt,deployment:b.lazy(()=>Lt)}).strict(),bU=U($E).strict(),VE=b.object({workflow:jt,can_cancel:b.boolean(),quality_result:tp.optional(),safety_gate_enabled:b.boolean().optional(),repair_result:ip.optional(),final_quality_result:tp.optional(),message:b.string().min(1).optional()}).strict(),yU=U(VE).strict();function xU(e){if(e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail))return[];let n=new Set(["heading_structure","click_obstruction","page_runtime_error"]);return e.quality_detail.dimensions.flatMap(s=>s.remediation_items.filter(i=>i.status==="succeeded"&&bi(i)==="not_passed"&&i.auto_fix&&n.has(i.item_code)).map(i=>({item_code:i.item_code,remediation_items:i.remediation_items})))}function EU(e,n){let s=e.map(o=>o.item_code),i=n.items.map(o=>o.item_code);if(new Set(s).size!==s.length||new Set(i).size!==i.length||s.length!==i.length)return!1;let a=new Set(s);return n.items.every(o=>a.has(o.item_code)&&o.repair_status==="succeeded")}function RU(e,n){return e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail)||YE(e)?null:e}function YE(e){let n=e.quality_info.error_info;return e.quality_info.scene_code!=="site_publish"||n?.stage!=="html_sampling"||n.code!=="PAGE_SAMPLING_ISSUES"&&n.code!=="PAGE_RUNTIME_ERRORS"?!1:[n.failed_urls,n.sampling_issues].flatMap(i=>Array.isArray(i)?i:[]).some(i=>{if(!i||typeof i!="object")return!1;let a=i;if(a.page_type!=="general_page"||a.http_status!==404||typeof a.url!="string")return!1;try{let o=new URL(e.quality_info.checked_url),c=new URL(a.url,o);return c.origin===o.origin&&!c.username&&!c.password}catch{return!1}})}var IU=b.enum(["checking","passed","not_passed","failed","not_checked"]);function bi(e){if(e.status==="pending"||e.status==="running")return"checking";if(e.status!=="succeeded")return"failed";let n=e.result_text?.trim();if(n==="\u8D28\u68C0\u9879\u5173\u95ED\uFF0C\u6682\u672A\u68C0\u6D4B")return"not_checked";if(n==="\u8D28\u91CF\u68C0\u6D4B\u9879\u6267\u884C\u5931\u8D25")return"failed";let s=typeof e.check_result=="boolean"?[e.check_result]:e.check_result&&typeof e.check_result=="object"?Object.values(e.check_result):[];return e.score<e.total_score||s.includes(!1)?"not_passed":"passed"}function XE(e){let n=bi(e);return n==="failed"||n==="not_passed"}function TU(e){let n={status:"unavailable",issueCount:0};if(!e||e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail))return n;let s=e.quality_detail.dimensions.filter(o=>o.dimension_code==="safe");if(s.length!==1)return n;let i=s[0];if(i.running_status!=="completed"||!i.remediation_items.length||i.remediation_items.some(o=>o.dimension_code!=="safe"||bi(o)==="checking"||bi(o)==="not_checked"))return n;let a=i.remediation_items.filter(XE).length;return a>0?{status:"blocked",issueCount:a}:i.score<i.pass_score?n:{status:"passed",issueCount:0}}var QE=Fe.object({hostname:Fe.string().min(1),expected_revision:Fe.number().int().nonnegative()}).strict(),ap=Fe.object({workflow:jt,operation:fi}).strict(),ZE=U(ap).strict(),JE=Fe.object({expected_revision:Fe.number().int().nonnegative()}).strict(),eR=Fe.object({workflow:jt,operation:fi}).strict(),tR=U(eR).strict(),Eo=Fe.object({workflow:jt,operation:fi.nullable()}).strict(),nR=U(Eo).strict(),sR=Eo,iR=U(sR).strict(),vU=U(ep).strict(),aR=Fe.object({published:Fe.boolean(),hostname:Fe.string(),url:Fe.string(),sandbox_url:Fe.union([Fe.string().url(),Fe.literal("")])}).strict().superRefine((e,n)=>{e.published||(e.hostname!==""&&n.addIssue({code:"custom",path:["hostname"],message:"unpublished sites must not include a hostname"}),e.url!==""&&n.addIssue({code:"custom",path:["url"],message:"unpublished sites must not include a URL"}))}),DU=U(aR).strict(),OU=QE,NU=ap,jU=ZE,LU=Eo,MU=nR,UU=iR,FU=JE,GU=tR;import{z as ze}from"zod";var oR=["started","success","failed","canceled"],Ro=ze.enum(oR),rR=["inactive","pending_binding","active"],Io=ze.enum(rR),cR=["domain","url_prefix"],To=ze.enum(cR),mR=["not_connected","authorizing","matching_property","ready","failed","canceled","domain_mismatch"],ko=ze.enum(mR),pt=ze.string().nullable(),op=ze.object({}).strict(),Ao=ze.object({authorize_url:ze.string().url(),custom_domain:pt}).strict(),rp=U(Ao),lR=ze.object({auth_status:Ro,binding_status:Io,credential_connected:ze.boolean(),custom_domain:pt,gsc_site_url:pt,property_type:To.nullable(),auth_error_code:pt,auth_error_message:pt}).strict(),cp=ze.object({auth_status:Ro,binding_status:Io,credential_connected:ze.boolean(),custom_domain:pt,gsc_site_url:pt,property_type:To.nullable(),auth_error_code:pt,auth_error_message:pt,current_domain:pt,state:ko,ready:ze.boolean()}).strict().superRefine((e,n)=>{let s=dR(e,e.current_domain),i=s==="ready";e.state!==s&&n.addIssue({code:"custom",path:["state"],message:`state must equal ${s} for the supplied GSC facts`}),e.ready!==i&&n.addIssue({code:"custom",path:["ready"],message:`ready must equal ${String(i)} for the supplied GSC facts`})}),pR=U(cp);function ls(e){let n=e?.trim()??"";if(!n)return"";let s=/^[a-z][a-z0-9+.-]*:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).hostname.replace(/\.+$/,"").toLowerCase()}catch{return n.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0].replace(/\.+$/,"").toLowerCase()}}function dR(e,n){let s=e.gsc_site_url?.trim()??"",i=ls(e.custom_domain),a=ls(n??("current_domain"in e?e.current_domain:void 0)),o=i.length>0&&a.length>0&&i===a,c=uR(s,e.property_type,a);return e.auth_status==="canceled"?"canceled":e.auth_status==="failed"?"failed":e.auth_status==="started"?"authorizing":!e.credential_connected||e.binding_status==="inactive"?"not_connected":s.length===0||e.property_type===null?"matching_property":!o||!c?"domain_mismatch":e.binding_status==="pending_binding"?"matching_property":e.auth_status==="success"&&e.binding_status==="active"&&e.credential_connected&&s.length>0&&o&&c?"ready":"failed"}function uR(e,n,s){let i=e?.trim()??"",a=ls(s);if(!i||!a||!n)return!1;if(n==="domain"){let o=/^sc-domain:(.+)$/i.exec(i);if(!o)return!1;let c=o[1].trim();if(!c||/[/:?#]/.test(c))return!1;let r=ls(c);return r?a===r||a.endsWith(`.${r}`):!1}try{let o=new URL(i);return o.protocol!=="https:"||o.username||o.password||o.port||o.pathname!=="/"||o.search||o.hash?!1:ls(o.hostname)===a}catch{return!1}}var KU=op,zU=Ao,HU=rp,$U=ko,VU=Ro,YU=Io,XU=To,QU=ko,ZU=op,JU=Ao,eF=rp,tF=lR,nF=cp,sF=pR;import{z as N}from"zod";var He=N.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),st=N.string().min(1).max(4096),yn=N.string().regex(/^[A-Za-z0-9_-]{43}$/),xn=N.string().max(300),wo=N.string().datetime({offset:!0}).nullable(),mp=N.string().regex(/^[A-Z][A-Z0-9_]*$/).max(100).nullable(),_R=["authorized","pending","failed","revoked","expired","not_authorized"],gR=N.enum(_R),hR=["pending","succeeded","failed","canceled","expired","superseded"],SR=N.enum(hR),fR=["unconfigured","configured","needs_reconfiguration","unverified"],bR=N.enum(fR),yR=["not_checked","valid","invalid","unavailable"],xR=N.enum(yR),ER=["authorization_pending","authorization_required","authorization_changed","resource_unavailable","resource_changed","verification_required","verification_unavailable"],RR=N.enum(ER),lp=N.object({revision:He,status:SR,started_at:N.string().datetime({offset:!0}),expires_at:N.string().datetime({offset:!0}),finished_at:wo,error_code:mp}).strict(),rF=N.object({expected_authorization_revision:He,expected_attempt_revision:He,select_account:N.boolean().default(!1),replace_pending:N.boolean().default(!1)}).strict(),IR=N.object({authorize_url:N.string().url(),authorization_revision:He,attempt:lp}).strict(),cF=U(IR),TR=N.object({status:gR,authorization_revision:He,account_email:N.string().max(320).nullable(),latest_attempt:lp.nullable()}).strict(),kR=N.object({account_ref:st,account_key:yn,account_display_name:xn,property_ref:st,property_key:yn,property_display_name:xn,data_stream_ref:st,data_stream_key:yn,data_stream_display_name:xn,measurement_id_display:N.string().min(1).max(40),default_uri:N.string().url().nullable(),selected_authorization_revision:He,configured_at:N.string().datetime({offset:!0}),updated_at:N.string().datetime({offset:!0})}).strict(),AR=N.object({status:xR,checked_at:wo,expires_at:wo,error_code:mp}).strict(),wR=N.enum(["oauth","verification"]),PR=N.object({measurement_id_display:N.string().min(1).max(40),stream_display_name:N.string().max(100).nullable()}).strict(),CR=N.object({status:N.enum(["pending","applied"]),applied_revision:He}).strict(),pp=N.object({capability_enabled:N.boolean(),revision:He,authorization:TR,binding_status:bR,reason:RR.nullable(),ready:N.boolean(),mode:wR.nullable(),binding:kR.nullable(),verification:AR,tracking:PR.nullable(),deployment:CR}).strict().superRefine((e,n)=>{if(!e.capability_enabled){(e.ready||e.revision!==0||e.authorization.status!=="not_authorized"||e.authorization.authorization_revision!==0||e.authorization.account_email!==null||e.authorization.latest_attempt!==null||e.binding_status!=="unconfigured"||e.reason!==null||e.mode!==null||e.binding!==null||e.tracking!==null||e.deployment.status!=="applied"||e.deployment.applied_revision!==0||e.verification.status!=="not_checked"||e.verification.checked_at!==null||e.verification.expires_at!==null||e.verification.error_code!==null)&&n.addIssue({code:N.ZodIssueCode.custom,message:"disabled GA4 capability must expose an empty state"});return}e.ready&&(e.authorization.status!=="authorized"||e.binding_status!=="configured"||e.mode!=="oauth"||e.binding===null||e.tracking===null||e.verification.status!=="valid"||e.reason!==null)&&n.addIssue({code:N.ZodIssueCode.custom,message:"ready GA4 status must be authorized, configured, and valid"})}),mF=U(pp),lF=N.object({refresh:N.union([N.boolean(),N.enum(["true","false"]).transform(e=>e==="true")]).default(!1)}).strict(),vR=N.object({property_ref:st,property_key:yn,display_name:xn}).strict(),DR=N.object({account_ref:st,account_key:yn,display_name:xn,properties:N.array(vR)}).strict(),OR=N.object({accounts:N.array(DR),returned_count:N.number().int().nonnegative(),completeness:N.literal("unknown"),authorization_revision:He}).strict(),pF=U(OR),dF=N.object({authorization_revision:N.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),NR=N.object({data_stream_ref:st,data_stream_key:yn,display_name:xn,measurement_id_display:N.string().min(1).max(40),default_uri:N.string().url().nullable(),selectable:N.boolean(),unavailable_reason:N.string().max(100).nullable()}).strict(),jR=N.object({property_ref:st,streams:N.array(NR),returned_count:N.number().int().nonnegative(),completeness:N.literal("unknown"),authorization_revision:He}).strict(),uF=U(jR),_F=N.object({property_ref:st,authorization_revision:N.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),gF=N.object({expected_revision:He,authorization_revision:He,account_ref:st,property_ref:st,data_stream_ref:st,confirm_url_mismatch:N.boolean()}).strict(),LR=N.object({applied_revision:He,idempotency_replayed:N.boolean()}).strict(),MR=pp.and(N.object({mutation:LR}).strict()),hF=U(MR);var dp=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,up="VCP_E2B_PREVIEW_PROXY_DOMAIN must be a valid hostname.";function UR(e){let n=e?.trim().toLowerCase()??"";if(!n)return null;if(n.length>253||!n.includes(".")||!n.split(".").every(s=>dp.test(s)))throw new Error(up);return n}function fF(e){let n=UR(e.proxyDomain);if(!n)return null;let s=e.sandboxId.trim();if(!dp.test(s))throw new Error("sandboxId must be a valid DNS label.");if(`${s}.${n}`.length>253)throw new Error(up);return`https://${s}.${n}/`}function yF(e){for(let n of e.targets)if(!(n.kind==="shared"?e.ledger.shared.some(i=>i.kind==="shared"&&i.target_id===n.target_id&&i.filled!==!0):e.ledger.pages.some(i=>i.omissions.some(a=>a.kind===n.kind&&a.target_id===n.target_id&&a.filled!==!0))))return{ok:!1,target_id:n.target_id};return{ok:!0}}function FR(e,n,s=e){let i=new Map(e.map(r=>[r.slug,r])),a=new Map(s.map(r=>[r.id,r])),o=new Map(e.map(r=>{let m=a.get(r.id);return m&&m.slug!==null&&m.slug!==r.slug?[m.slug,r]:null}).filter(r=>r!==null)),c=new Set(s.map(r=>r.slug).filter(r=>r!==null&&!i.has(r)));return{primaryLinks:_p(n.primaryLinks,e,i,o,c,a,"showInHeader"),footerLinks:_p(n.footerLinks,e,i,o,c,a,"showInFooter")}}function _p(e,n,s,i,a,o,c){let r=new Set,m=[];for(let[K,H]of e.entries()){let se=GR(H.href),fe=se===null?void 0:s.get(se)??i.get(se);if(se!==null&&a.has(se)&&!s.has(se)&&!i.has(se))continue;if(fe?.slug==="/"){m.push({kind:"independent",link:{...H,label:gp(H,fe,o)}});continue}if(!fe){m.push({kind:"independent",link:H});continue}if(!fe.navigation[c])continue;r.add(fe.slug);let kn=se===fe.slug?H.href:qR(H.href,fe.slug);m.push({kind:"page",page:fe,link:{...H,label:gp(H,fe,o),href:kn},index:K})}let x=m.filter(K=>K.kind==="page").sort((K,H)=>K.page.navigation.order-H.page.navigation.order||K.index-H.index),_=0,P=m.map(K=>K.kind==="page"?x[_++].link:K.link);for(let K of[...n].filter(H=>H.slug!=="/"&&H.navigation[c]).sort((H,se)=>H.navigation.order-se.navigation.order))r.has(K.slug)||P.push({label:K.title,href:K.slug});return P}function gp(e,n,s){let i=s.get(n.id);return e.label===(i?.title??n.title)?n.title:e.label}function GR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/u);return n===-1?e:e.slice(0,n)}function qR(e,n){let s=e.search(/[?#]/u);return s===-1?n:`${n}${e.slice(s)}`}function xi(e){return e.trim().normalize("NFKC").toLowerCase()}function WR(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u9996\u9875":n?.startsWith("ja")?"\u30DB\u30FC\u30E0":n?.startsWith("ko")?"\uD648":"Home"}function BR(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u66F4\u591A":n?.startsWith("ja")?"\u305D\u306E\u4ED6":n?.startsWith("ko")?"\uB354\uBCF4\uAE30":n?.startsWith("fr")?"Plus":n?.startsWith("de")?"Mehr":n?.startsWith("es")?"M\xE1s":"More"}function KR(e){return e.map(n=>n.navigation.showInHeader===!0?n:{...n,navigation:{...n.navigation,showInHeader:!0}})}function ps(e){return e.parent_page_id??null}function Ei(e,n){let s=ps(e);return s===null?!0:!n.some(i=>i.id===s)}function hp(e,n){return e.filter(s=>ps(s)===n&&s.id!==n)}function Sp(e){let n=e.filter(c=>Ei(c,e)),s=n.filter(c=>c.slug==="/"),i=n.filter(c=>c.slug!=="/"),a=[],o=new Set;for(let c of[...s,...i])if(!o.has(c.id)){a.push(c),o.add(c.id);for(let r of hp(e,c.id))o.has(r.id)||(a.push(r),o.add(r.id))}for(let c of e)o.has(c.id)||(a.push(c),o.add(c.id));return a}function zR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/);return n===-1?e:e.slice(0,n)}function HR(e,n){let s=Sp(n),i=new Map;s.forEach((c,r)=>{c.slug!==null&&!i.has(c.slug)&&i.set(c.slug,r)});let a=[],o=[];for(let c of e){let r=zR(c.href),m=r===null?void 0:i.get(r);m===void 0?o.push(c):a.push({link:c,rank:m})}return a.sort((c,r)=>c.rank-r.rank),[...a.map(c=>c.link),...o]}function $R(e){let n=e.filter(s=>Ei(s,e)).length;return{top_level_pages:n,sub_pages:e.length-n,total_pages:e.length,content_items:e.reduce((s,i)=>s+i.blocks.length,0)}}function VR(e,n={}){let s=[],i=new Map(e.map(c=>[c.id,c])),a=e.filter(c=>c.slug==="/");a.length!==1?s.push({code:"missing_home",page_id:null,message:"The structure must contain exactly one home page."}):n.expectedHomeTitle&&xi(a[0].title)!==xi(n.expectedHomeTitle)&&s.push({code:"home_renamed",page_id:a[0].id,message:`The home page must keep its fixed name '${n.expectedHomeTitle}'.`});for(let c of e){c.title.trim().length===0&&s.push({code:"empty_title",page_id:c.id,message:"Page name is empty."}),c.slug&&n.reservedSlugs?.includes(c.slug)&&s.push({code:"reserved_slug",page_id:c.id,message:`Slug '${c.slug}' is reserved by the site's applications.`});let r=ps(c);if(r===null)continue;if(c.slug==="/"){s.push({code:"home_has_parent",page_id:c.id,message:"The home page cannot have a parent."});continue}if(r===c.id){s.push({code:"self_parent",page_id:c.id,message:"A page cannot be its own parent."});continue}let m=i.get(r);if(!m){s.push({code:"parent_not_found",page_id:c.id,message:`Parent page '${r}' does not exist.`});continue}if(m.slug==="/"){s.push({code:"home_has_children",page_id:c.id,message:"The home page cannot have sub pages."});continue}ps(m)!==null&&s.push({code:"depth_exceeded",page_id:c.id,message:"At most two levels are allowed."})}let o=new Map;for(let c of e){let r=Ei(c,e)?"__top__":ps(c),m=xi(c.title);if(m.length===0)continue;let x=o.get(r)??new Map,_=x.get(m);_!==void 0&&_!==c.id?s.push({code:"duplicate_sibling_title",page_id:c.id,message:`Page name '${c.title}' is already used at the same level.`}):x.set(m,c.id),o.set(r,x)}return s}var YR=16,XR=/[ᄀ-ᅟ⺀-〾ぁ-㏿㐀-䶿一-鿿ꀀ-가-힣豈-︰--⦆¢-₩]/u;function QR(e){let n=0;for(let s of e)n+=XR.test(s)?2:1;return n}function ZR(e){let n=e.normalize("NFKC").trim().replace(/\s+/g," ").toLowerCase();return n.length>3&&n.endsWith("s")?n.slice(0,-1):n}import{z as A}from"zod";var fp=20*1024*1024,JR=fp,bp=["jpg","jpeg","png","gif","webp","bmp"],yp=["mp4","avi","mov","webm","mkv"],xp=["mp3","wav","aac","flac","ogg","wma","m4a"],Ep=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv"],Rp=[...Ep,"zip","rar","xmind","psd","ai","fig","sketch"],eI=[...bp,...yp,...xp,...Rp],Ip=["image/jpeg","image/png","image/gif","image/webp","image/bmp"],Tp=["video/mp4","video/x-msvideo","video/quicktime","video/webm","video/x-matroska"],kp=["audio/mpeg","audio/wav","audio/x-wav","audio/vnd.wave","audio/aac","audio/flac","audio/x-flac","audio/ogg","audio/x-ms-wma","audio/mp4","audio/x-m4a"],tI=[...Ip,...Tp,...kp],Ap=A.enum(["image","video","audio","document","file"]),wp=A.enum(["external","ai_generated","unsplash"]),Po=A.object({resource_id:A.string().min(1),name:A.string().min(1).max(255),url:A.string().url(),thumbnail_url:A.union([A.string().url(),A.literal("")]),mime_type:A.string().trim().min(3).max(127),size:A.number().int().nonnegative(),width:A.number().int().positive().nullable(),height:A.number().int().positive().nullable(),source:wp,created_at:A.string().min(1).nullable()}),nI=A.object({page:A.coerce.number().int().min(1).default(1),page_size:A.coerce.number().int().min(1).max(100).default(24),keyword:A.string().trim().max(100).optional(),file_type:Ap.default("image")}),sI=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(Po),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative()})}),iI=A.object({code:A.literal(0),message:A.string(),data:Po}),Co=4,aI=A.object({pageName:A.string().trim().min(1).max(200),pageType:A.enum(["landing_page","general_page","detail_page","list_page","category_page","tag_page","author_page","search_page","date_page"]),sectionTitle:A.string(),nearbyTitle:A.string(),nearbyBody:A.string(),prompt:A.string().trim().min(1).max(2e3),aspectRatio:A.string().regex(/^[1-9]\d*:[1-9]\d*$/)}),Pp=A.object({index:A.number().int().min(0).max(Co-1),ok:A.literal(!0),url:A.string().regex(/^data:image\/(?:png|jpeg|gif|webp|bmp);base64,[A-Za-z0-9+/]+={0,2}$/)}),oI=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(Pp).min(1).max(Co)})}),Cp=A.object({provider_id:A.string().min(1),url:A.string().url(),thumbnail_url:A.string().url(),width:A.number().int().positive(),height:A.number().int().positive(),alt:A.string(),photographer_name:A.string().min(1),photographer_url:A.string().url(),photo_url:A.string().url(),download_location:A.string().url(),dominant_color:A.string().nullable()}),rI=A.object({query:A.string().trim().min(1).max(100),page:A.coerce.number().int().min(1).default(1),page_size:A.coerce.number().int().min(1).max(30).default(18),orientation:A.enum(["landscape","portrait","squarish"]).optional()}),cI=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(Cp),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative(),total_pages:A.number().int().nonnegative()})}),vp=A.string().url().refine(uI,{message:"download_location must be an official Unsplash download URL"}),mI=A.object({download_location:vp}),lI=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})}),pI=A.object({source_id:A.number().int().positive(),source_title:A.string().min(1).max(255),source_url:Kt,resource_id:A.number().int().positive()}),dI=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})});function uI(e){if(!URL.canParse(e))return!1;let n=new URL(e);return n.protocol==="https:"&&n.hostname==="api.unsplash.com"&&n.username===""&&n.password===""&&n.port===""&&n.hash===""&&/^\/photos\/[^/]+\/download$/.test(n.pathname)}import{z as le}from"zod";var _I=le.object({colorSeeds:le.object({primary:le.string().min(1).max(40),accent:le.string().min(1).max(40),foreground:le.string().min(1).max(40).optional()}).strict().optional(),surfaceMode:le.enum(["light","dark"]).optional(),fonts:le.object({heading:le.string().min(1).max(60),body:le.string().min(1).max(60)}).strict().optional(),weightStyle:Ke.optional()}).strict().refine(e=>e.colorSeeds!==void 0||e.surfaceMode!==void 0||e.fonts!==void 0||e.weightStyle!==void 0,{message:"colorSeeds, surfaceMode, fonts, or weightStyle is required"}),gI=le.object({ok:le.literal(!0),design_plan_version:le.number().int().positive().optional(),snapshot_id:I,site_design_context:le.lazy(()=>Ri).optional(),changed_files:le.array(le.string().min(1)).optional()}),hI=le.object({snapshot_id:I,color_seeds:le.object({primary:le.string(),accent:le.string(),foreground:le.string().optional()}).nullable(),surface_mode:le.enum(["light","dark"]).nullable(),fonts:le.object({heading:le.string(),body:le.string()}).nullable(),palette_inputs_present:le.boolean(),palette_inputs:La.nullable(),notes:le.array(le.string()).nullable(),weight_style:Ke.nullable().default(null),source:le.enum(["globals_css","design_plan_archive"])});import{z as w}from"zod";var ye=w.string().min(1).max(100),Do=w.enum(["page","anchor","external","email","phone","file","group"]);function SI(e){if(!e||e.trim()!==e||/[\u0000-\u001f\u007f\\]/u.test(e))return!1;if(e.startsWith("/")&&!e.startsWith("//")||/^#[^\s]*$/u.test(e)||/^(mailto:|tel:)[^\s]+$/iu.test(e))return!0;try{let n=new URL(e);return(n.protocol==="http:"||n.protocol==="https:")&&!n.username&&!n.password}catch{return!1}}var fI=w.string().max(2048).refine(SI,"Invalid navigation destination"),Oo=w.string().trim().min(1).max(255),No=w.enum(["link","cta"]).nullable(),Dp=w.lazy(()=>w.object({id:ye,group_id:ye,parent_id:ye.nullable(),sort_order:w.number().int().nonnegative(),label:w.string(),href:w.string().nullable(),target_type:Do,enabled:w.boolean(),effective_visible:w.boolean(),open_in_new:w.boolean(),nofollow:w.boolean(),role:No,link_binding:w.object({kind:w.enum(["custom","cms_page","file"]),page_id:ye.nullable()}),children:w.array(Dp)})),bI=w.object({id:ye,name:w.string(),description:w.string(),is_default:w.boolean(),can_delete:w.boolean(),delete_block_reason:w.string().nullable(),items:w.array(Dp)}),yI=w.object({site_id:w.string().min(1),default_group_id:ye.nullable(),groups:w.array(bI),limits:w.object({max_depth:w.number().int().positive(),max_items:w.number().int().positive()})}),jF=w.object({data:yI}),Op=w.object({name:Oo,description:w.string().max(2e3).optional()}).strict(),xI=Op.partial().refine(e=>Object.keys(e).length>0,"At least one field is required"),LF=w.object({group_id:ye}).strict(),Np={label:Oo,target_type:Do,href:fI.nullable().optional(),enabled:w.boolean().optional(),open_in_new:w.boolean().optional(),nofollow:w.boolean().optional(),role:No.optional()},jp=w.object({group_id:ye,parent_id:ye.nullable().optional(),...Np}).strict().superRefine((e,n)=>{e.target_type!=="group"&&!e.href&&n.addIssue({code:"custom",path:["href"],message:"Link destination is required"}),e.target_type==="group"&&e.href&&n.addIssue({code:"custom",path:["href"],message:"Groups have no destination"})}),EI=w.object({...Np,link_mode:w.literal("custom").optional()}).partial().strict().refine(e=>Object.keys(e).length>0,"At least one field is required"),RI=w.object({group_id:ye,parent_id:ye.nullable(),before_id:ye.nullable().optional()}).strict(),vo=w.lazy(()=>w.object({id:ye.nullable(),label:w.string().max(255),href:w.string().max(2048).nullable(),target_type:Do,enabled:w.boolean(),open_in_new:w.boolean(),nofollow:w.boolean(),role:No,children:w.array(vo)}).strict()),MF=w.object({group_id:ye.nullable(),group_name:Oo.optional(),baseline:w.array(vo),items:w.array(vo)}).strict().superRefine((e,n)=>{e.group_id===null&&e.items.length>0&&!e.group_name&&n.addIssue({code:"custom",path:["group_name"],message:"New navigation group name is required"});for(let s of["baseline","items"]){let i=new Set,a=0,o=(c,r,m)=>{for(let[x,_]of c.entries()){let P=[...m,x];if(a++,s==="items"&&(a>1e3||r>20)){n.addIssue({code:"custom",path:P,message:"Navigation tree limit exceeded"});return}if((s==="baseline"&&_.id===null||_.id!==null&&i.has(_.id))&&n.addIssue({code:"custom",path:[...P,"id"],message:"Invalid or duplicate navigation ID"}),_.id!==null&&i.add(_.id),s==="items"){let K=jp.safeParse({group_id:e.group_id??"new",label:_.label,href:_.href,target_type:_.target_type,enabled:_.enabled,open_in_new:_.open_in_new,nofollow:_.nofollow,role:_.role});if(!K.success)for(let H of K.error.issues)n.addIssue({code:"custom",path:[...P,...H.path.filter(se=>typeof se=="string"||typeof se=="number")],message:H.message})}o(_.children,r+1,[...P,"children"])}};o(e[s],1,[s])}}),II=w.object({cms_bound:w.boolean(),bound_nav_keys:w.array(w.string()).optional(),analyzed_snapshot_id:w.string().nullable().optional(),cms_driven:w.boolean(),supports_groups:w.boolean(),supports_nested_groups:w.boolean(),supports_link_attributes:w.boolean(),requires_agent:w.boolean(),reasons:w.array(w.string())}),UF=w.object({data:II}),FF=w.discriminatedUnion("action",[w.object({action:w.literal("create_group"),values:Op}).strict(),w.object({action:w.literal("update_group"),id:ye,values:xI}).strict(),w.object({action:w.literal("delete_group"),id:ye}).strict(),w.object({action:w.literal("set_default_group"),group_id:ye}).strict(),w.object({action:w.literal("create_item"),values:jp}).strict(),w.object({action:w.literal("update_item"),id:ye,values:EI}).strict(),w.object({action:w.literal("delete_item"),id:ye,cascade:w.boolean().optional()}).strict(),w.object({action:w.literal("move_item"),id:ye,values:RI}).strict()]);import{z as pe}from"zod";var jo=pe.enum(["products","cases","guides","documents","company"]),TI=pe.enum(["source_unreachable","content_mojibake","min_fields_unmet","document_no_file_reference","document_file_unavailable","media_ingest_failed","app_unavailable","write_failed","kind_input_unavailable","kind_uncertain","kind_service_unavailable","kind_budget_exhausted"]),Rt=pe.number().int().nonnegative(),kI=pe.discriminatedUnion("status",[pe.object({collection:jo,status:pe.literal("processing")}).strict(),pe.object({collection:jo,status:pe.enum(["imported","partial","failed"]),imported:Rt,exception:Rt}).strict()]),Lp=pe.enum(["legacy_domain_not_routed","site_context_missing","site_rules_limit_exceeded","site_rules_not_served"]),AI=pe.enum(["target_page_unpublished","redirect_target_missing","redirect_write_failed",...Lp.options]),wI=pe.discriminatedUnion("status",[pe.object({status:pe.literal("processing")}).strict(),pe.object({status:pe.literal("unavailable")}).strict(),pe.object({status:pe.literal("ready"),site_reason:Lp.nullable(),same_path:Rt,active:Rt,exception:Rt,exceptions:pe.array(pe.object({path:pe.string().regex(/^\/[^?#]*$/),reason_code:AI}))})]),WF=pe.object({overall_status:pe.enum(["moving","completed","disabled","failed"]),by_collection:pe.array(kI),media:pe.object({image:Rt,video:Rt,audio:Rt,file:Rt}),exceptions:pe.array(pe.object({collection:jo.nullable(),path:pe.string().regex(/^\/[^?#]*$/),reason_code:TI})),redirects:wI.nullable().optional()});import{z as ds}from"zod";var zF=ds.strictObject({display_name:ds.string().nullable(),account_category:ds.number().int().nullable()}),HF=ds.strictObject({redirect_url:ds.url({protocol:/^https$/}).refine(e=>{try{let n=new URL(e);return!n.username&&!n.password}catch{return!1}})});import{z as O}from"zod";var PI=O.enum(["not_published","waiting_domain","not_started","creating","running","ready","failed","unavailable"]),CI=O.object({code:O.string().min(1),message:O.string().min(1),retryable:O.boolean()}).strict(),vI=O.object({phase:PI,runId:O.uuid().nullable(),progress:O.number().min(0).max(1).nullable(),hasExecutionWarning:O.boolean(),error:CI.nullable()}).strict(),YF=O.object({code:O.literal(0),message:O.literal("ok"),data:vI}).strict(),DI=["performance","experience","index","ai","compliance"],Up=O.enum(DI),OI=O.object({key:Up,title:O.string(),value:O.string(),providerLabel:O.string().nullable(),description:O.string()}).strict(),NI=O.object({key:O.string(),label:O.string(),description:O.string(),value:O.union([O.string(),O.number(),O.null()]),displayValue:O.string(),progress:O.number().min(0).max(1).nullable()}).strict(),jI=O.object({key:Up,title:O.string(),badge:O.string(),metrics:O.array(NI)}).strict(),LI=O.object({cards:O.array(OI).length(5).refine(e=>new Set(e.map(n=>n.key)).size===5,"Each health card key must occur exactly once"),details:O.array(jI).length(5).refine(e=>new Set(e.map(n=>n.key)).size===5,"Each health detail key must occur exactly once")}).strict(),XF=O.object({code:O.literal(0),message:O.literal("ok"),data:LI}).strict(),QF=O.object({}).strict(),MI=O.string().regex(/^\d{1,18}$/),Mp=O.object({checkCode:O.string().regex(/^[A-Za-z][A-Za-z0-9_.-]{0,127}$/),name:O.string().min(1).max(128),execution:O.enum(["queued","running","completed","failed"]),conclusion:O.enum(["passed","failed","unknown","unavailable"])}).strict(),UI=O.object({total:O.number().int().nonnegative(),passed:O.number().int().nonnegative(),failed:O.number().int().nonnegative(),unknown:O.number().int().nonnegative(),unavailable:O.number().int().nonnegative(),executionFailed:O.number().int().nonnegative()}).strict(),Lo={id:MI,runId:O.uuid(),createdAt:O.iso.datetime()},ZF=O.discriminatedUnion("type",[O.object({...Lo,type:O.literal("accepted"),data:O.object({runId:O.uuid(),checks:O.array(Mp).min(1).max(1e3)}).strict()}).strict(),O.object({...Lo,type:O.literal("check.updated"),data:Mp}).strict(),O.object({...Lo,type:O.enum(["progress","completed","failed"]),data:O.object({status:O.enum(["queued","running","completed","failed"]).optional(),summary:UI}).strict()}).strict()]),JF=O.object({code:O.literal("INITIAL_REVIEW_STREAM_INTERRUPTED"),retryable:O.literal(!0)}).strict();var Fo=t.object({heading:t.string().min(1).max(160).optional(),body:t.string().min(1).max(160).optional(),paletteIntent:t.string().min(1).max(400).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),density:t.enum(["compact","comfortable","airy","editorial"]).optional(),motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),themeId:t.string().min(1).max(60).optional(),themeDescription:t.string().min(1).max(400).optional(),aestheticNote:t.string().min(1).max(300).optional(),weightStyle:Ke.optional()}),Mo=t.enum(["material","reference","brief","industry"]),FI=t.object({market:t.object({value:t.string().min(1).max(200),source:Mo}),customer:t.object({value:t.string().min(1).max(200),source:Mo}),purpose:t.object({options:t.array(t.string().min(1).max(60)).min(2).max(4),selected:t.string().min(1).max(60),source:Mo})}),GI=t.enum(["text-options","motion-slider","positioning"]),Go=t.enum(["none","subtle","moderate","expressive"]),qI=t.enum(["compact","comfortable","airy","editorial"]),WI=Go,Kp=t.object({skill_name:t.string().min(1),rationale:t.string().min(4).max(200),confidence:t.enum(["high","medium","low"]).optional(),displayName:t.object({zh:t.string().min(1),en:t.string().min(1)}).partial().optional()}),BI=t.object({value:t.string(),label:t.string(),desc:t.string().optional(),impact:t.string().optional(),isRecommended:t.boolean().optional(),preselect:t.boolean().optional(),visualHints:Fo.optional(),conversionHints:Gt.optional()}),KI=t.object({id:t.string(),type:GI,question:t.string(),tag:t.string(),aiThinking:t.string(),options:t.array(BI),source:t.enum(["ai-detected","always-ask"]),sourceDetail:t.string(),positioning:FI.optional()}),qo=t.object({questions:t.array(KI).min(1).max(6)}),wG=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Zt,brief:t.string().min(20).max(1e3),site_default_locale:Te.optional(),owner_locale:Te.optional(),input_context:t.object({facts:t.array(bs).max(120),conflicts:t.array(xs).max(20),reference:ys.optional(),sources:t.array(t.object({type:Oi,title:t.string().max(120).optional(),status:Ni})).max(16).optional()}).optional()}),zp=t.enum(["model_schema_invalid","provider_rate_limited","provider_unavailable","aborted","unknown"]),PG=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Kp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:zp.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),at:t.string().min(1)})]),CG="SITE_PLANNING_INPUT_FROZEN",vG="SITE_PLANNING_LOCKED",DG="SITE_STRUCTURE_CONFIRMATION_REQUIRED",OG="SITE_STRUCTURE_CONFIRMATION_STALE",NG="SITE_SITEMAP_DRAFT_STALE",jG="SITE_SITEMAP_DRAFT_OPERATION_MISMATCH",Fp="SITE_STRUCTURE_INVALID",LG=t.object({tenant_id:t.string().min(1),name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),MG=t.object({name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),UG=t.object({name:t.string().min(1).max(120)}),FG=t.object({name:t.string().min(1).max(120),default_locale:Te.optional()}),GG=t.object({body:t.string().min(20).max(1e3)}),qG=t.object({body:t.string().min(20).max(1e3)}),Wo=t.string().url().refine(e=>{try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}},{message:"URL must use http or https protocol"}),WG=t.object({tenant_id:t.string().min(1),site_id:k.optional(),site_url:Wo.optional(),site_name:t.string().trim().min(1).max(255).optional()}),BG=U(Br),KG=U(Kr),zG=U(zr),HG=U(ac),$G=U(oc),VG=U(rc),YG=U(mc),XG=U(lc),QG=U(pc),ZG=U(t.object({site_id:k,site_url:Wo.nullable()})),Ut=t.object({id:k,tenant_id:t.string().min(1),name:t.string().min(1),slug:t.string().min(1),status:ua,deployment_status:_a,archived_at:t.string().min(1).nullable(),current_sitemap_id:we.nullable(),confirmed_sitemap_id:we.nullable().optional(),confirmed_sitemap_version:t.number().int().positive().nullable().optional(),structure_confirmed_at:t.string().min(1).nullable().optional(),migration_content_requested:t.boolean().optional(),current_snapshot_id:I.nullable(),published_deployment_id:dt.nullable().optional(),deployed_url:t.string().url().nullable(),default_locale:Te,owner_locale:Te.optional(),cms_site_id:Ts.nullable().optional(),cms_site_url:Wo.nullable().optional(),parent_site_id:k.nullable().optional(),mount_path:t.string().min(1).nullable().optional(),schema_version:t.literal(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),Bo=t.object({id:Zt,tenant_id:t.string().min(1),site_id:k,body:t.string().min(1),source:t.enum(["user","import","system"]),created_at:t.string().min(1),updated_at:t.string().min(1)}),JG=t.object({site:Ut,brief:Bo,next_step:t.literal("clarify")}),eq=t.object({site:Ut,brief:Bo}),tq=t.object({brief:Bo}),zI=t.enum(["queued","running","succeeded","failed","cancelled"]),Hp=t.enum(["clarify","sitemap","workspace"]),$p=t.enum(["clarify","sitemap","initial_generation","iteration","landing_page","fill_in"]),Vp=t.enum(["clarify","sitemap","workspace","summarize"]),it=t.object({id:V,tenant_id:t.string().min(1),site_id:k,agent_type:Hp,run_kind:$p,status:zI,model_route:Vp,started_at:t.string().min(1).nullable(),finished_at:t.string().min(1).nullable(),error_code:t.string().min(1).nullable(),created_at:t.string().min(1),thread_id:at.nullable().optional()}),nq=t.object({agent_run:it}).strict(),HI=t.enum(["workspace","landing_page","external"]),$I=t.enum(["user","background"]),Yp=t.enum(["active","archived"]),Ai=t.object({id:at,tenant_id:t.string().min(1),site_id:k,kind:HI,origin:$I,subject_key:t.string().min(1).max(200),title:t.string().min(1).max(200),status:Yp,external_thread_id:t.string().min(1).max(200).nullable(),last_run_id:V.nullable(),last_activity_at:t.string().min(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),sq=t.object({agent_run:it,thread:Ai.nullable()}),iq=t.object({run_id:V.optional(),site_id:k,agent_type:Hp,run_kind:$p.optional(),model_route:Vp,input:t.record(t.string(),t.unknown()).optional()}).superRefine((e,n)=>{us(e.input)&&n.addIssue({code:"custom",path:["input"],message:"Agent run input must not contain secrets"})}),aq=t.object({agent_run:it,next_step:t.literal("stream_events")}),Xp=t.enum(["draft","candidate","deleting","current","failed"]),It=t.object({id:I,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:et.nullable().optional(),reason:t.enum(["initial_generation","workspace_edit","pre_deploy","manual_save","rollback","template_upgrade","subsite_clone"]),status:Xp,created_at:t.string().min(1)}),oq=t.object({snapshot_id:I,creation_key:t.string().min(1),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:et.optional(),reason:It.shape.reason,status:t.enum(["draft","candidate","current","failed"]).default("candidate"),source_run_id:V.optional()}),rq=t.object({site:Ut,snapshot:It,next_step:t.literal("workspace")}),cq=t.object({expected_manifest_hash:It.shape.manifest_hash,manifest_hash:It.shape.manifest_hash,object_key:It.shape.object_key}).strict(),mq=t.union([t.object({base_snapshot_id:I.nullable(),source_run_id:V.optional(),page_template_advisories:t.array(Cn).optional()}).strict(),t.object({skip_base_check:t.literal(!0)}).strict()]),VI=t.object({site:Ut,snapshot:It,next_step:t.literal("workspace")}),lq=t.object({snapshot:It}),pq=t.object({status:t.literal("deleting"),snapshot_id:I,object_key:t.string().min(1)}),dq=t.object({status:t.literal("deleted"),snapshot_id:I}),wi=t.object({id:sr,tenant_id:t.string().min(1),site_id:k,snapshot_id:I,version:t.number().int().positive(),accepted_commit:t.string().min(1),source_run_id:V.nullable(),created_at:t.string().min(1)}),YI=wi.extend({reason:It.shape.reason,status:Xp}),uq=t.object({accepted_commit:t.string().min(1),source_run_id:V.optional()}),_q=t.object({site_version:wi,next_step:t.literal("workspace")}),gq=t.object({owner_id:t.string().min(1)}).strict(),hq=t.discriminatedUnion("acquired",[t.object({acquired:t.literal(!0)}).strict(),t.object({acquired:t.literal(!1)}).strict()]),Sq=t.object({owner_id:t.string().min(1)}).strict(),fq=t.object({released:t.literal(!0)}).strict(),bq="TEMPLATE_UPGRADE_LOCK_LOST",yq=t.object({base_snapshot_id:I,accepted_commit:wi.shape.accepted_commit,owner_id:t.string().min(1)}).strict(),xq=VI.strict(),Eq=t.object({site_versions:t.array(YI)}),Rq=t.object({site:Ut,snapshot:It,site_version:wi,next_step:t.literal("workspace")}),Iq=t.object({snapshot_id:I,force_rehydrate:t.boolean().optional(),recovery_required:t.boolean().optional(),required_cms_site_id:Ts.optional()}),XI=t.discriminatedUnion("status",[t.object({status:t.literal("ready"),snapshot_id:I,preview_url:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({status:t.literal("failed"),code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),snapshot_id:I.optional(),code_error:Gi.optional()})]),Tq=t.object({tenant_id:t.string().min(1),site_id:k,snapshot_id:I,cms_site_id:Ts.optional()}).strict(),kq=XI,Ko=t.enum(en),Qp=t.enum(["quality_check","publish"]),Lt=t.object({id:dt,tenant_id:t.string().min(1),site_id:k,snapshot_id:I,type:Qp.default("publish"),version:t.number().int().positive(),status:Ko,provider:t.enum(["cloudflare"]),url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),Aq=t.object({tenant_id:t.string().min(1),site_id:k,expected_snapshot_id:I}).strict(),wq=t.object({deployment:Lt}),Pq=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:dt}).strict(),Cq=t.object({deployment:Lt}),vq=t.object({}).strict(),Dq=t.object({snapshot_id:I.optional()}).strict(),QI=t.object({deployment:Lt}),Oq=U(QI),Nq=t.object({deployment:Lt.nullable()}),jq=t.object({deployment:Lt}),Gp=t.object({id:dt,type:Qp.default("publish"),status:Ko,url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable()}),ZI=t.object({current:Gp.nullable(),latest_released:Gp.nullable()}),Lq=U(ZI),JI=t.enum(["deployment.snapshot","deployment.status.changed","deployment.finished","deployment.failed","deployment.realtime.recovered","server.error"]),En=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,deployment_id:dt,seq:t.number().int().positive(),sent_at:t.string().min(1)}),Ii=t.object({deployment:Lt,steps:Jc.default([])}),Mq=t.discriminatedUnion("type",[En.extend({type:t.literal("deployment.snapshot"),payload:Ii}),En.extend({type:t.literal("deployment.status.changed"),payload:Ii}),En.extend({type:t.literal("deployment.finished"),payload:Ii}),En.extend({type:t.literal("deployment.failed"),payload:Ii}),En.extend({type:t.literal("deployment.realtime.recovered"),payload:t.object({action:t.literal("refresh")})}),En.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})})]),Uq=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:dt,status:Ko,updated_at:t.string().min(1)}),eT="vcp:deployments",Fq={path:"/v1/sites/:site_id/deployments/:deployment_id/socket",redis_channel:eT,outbound_message_schema:"DeploymentWsServerMessageSchema",message_types:[...JI.options]},tT=t.object({error:t.object({code:t.string().min(1),message:t.string().min(1),details:t.unknown().optional(),request_id:t.string().min(1).optional(),retryable:t.boolean().default(!1)})}),Gq=t.object({error:tT.shape.error.extend({code:t.literal("AGENT_RUN_IN_FLIGHT"),details:t.object({code:t.literal("AGENT_RUN_IN_FLIGHT"),message:t.string().min(1),agent_run:it})})}),qq=t.object({colors:t.record(t.string(),t.string()).default({}),typography:t.record(t.string(),t.string()).default({}),spacing:t.record(t.string(),t.string()).default({}),motion:t.record(t.string(),t.string()).default({})}),nT=t.object({theme_id:t.string().min(1),paletteIntent:t.string().min(1),tone:t.string().min(1),mediaMood:t.string().min(1),motionLevel:Go.optional(),userVisualHints:Fo.optional()}),sT=t.object({key:t.string().min(1).max(64).optional(),question:t.string().min(1),answer:t.string().min(1)}),Wq=t.object({query:t.string().min(1),keywords:t.array(t.string()).default([]),orientation:t.enum(["landscape","portrait","square"]).optional(),role:t.enum(["hero","section","card","gallery","testimonial","decorative"]),altHint:t.string().min(1)}),Bq=t.object({id:t.string().min(1),role:t.enum(["site_background","nav_background","footer_background"]),query:t.string().min(1),keywords:t.array(t.string()).default([]),treatment:t.enum(["cover","fixed-cover","subtle-texture"]),altHint:t.string().optional()}),iT=t.object({provider:t.enum(["unsplash","pexels"]),providerLabel:t.enum(["Unsplash","Pexels"]),providerHref:t.string().url(),photoHref:t.string().url().optional(),photographerName:t.string().optional(),photographerHref:t.string().url().optional(),requiresAttribution:t.boolean()}),Kq=t.object({src:t.string().min(1),alt:t.string().min(1),width:t.number().int().positive().optional(),height:t.number().int().positive().optional(),provider:t.enum(["unsplash","pexels","placeholder"]).optional(),providerId:t.string().optional(),photoUrl:t.string().url().optional(),photographer:t.string().optional(),photographerUrl:t.string().url().optional(),credit:t.string().optional(),dominantColor:t.string().optional(),attribution:iT.optional()}),aT=t.enum(["system_recommended","user_picked","user_picked_extended","deterministic_fallback"]),Rn=t.object({id:t.string().min(1),name:t.string().min(1),category:t.literal("page-generation"),version:t.string().min(1).optional(),reason:t.string().min(1).max(200),source:aT.default("system_recommended")}),oe=t.string().min(1).max(2e3),qp=t.string().min(1).max(120),Ri=t.object({visualDirection:oe,brandFeeling:oe,paletteIntent:oe,typographyIntent:oe,density:qI,motionLevel:WI,motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),mediaStrategy:oe,compositionRules:t.array(oe).max(20),avoidPatterns:t.array(oe).max(20),fonts:t.object({heading:t.string().min(1),body:t.string().min(1)}).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),weightStyle:Ke.optional()}),zo=160,Zp=t.object({routeGoal:oe,narrativeArc:oe,firstViewportIntent:oe,visualContinuity:oe,sectionRhythm:oe,avoidPatterns:t.array(oe).max(20),displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(zo).optional(),metaTitle:t.string().min(1).max(120).optional(),metaDescription:t.string().min(1).max(320).optional(),primaryKeyword:t.string().min(1).max(160).optional(),longTailKeywords:t.array(t.string().min(1).max(160)).max(3).optional()}),Jp=t.enum(["model_call","validation","repair","preview","worker_group"]),Mt=t.enum(["generating","generating_design_plan","checking_quality","updating_design_memory"]),ed=t.object({sectionRole:oe,contentIntent:oe,layoutIntent:oe,visualIntent:oe,mediaIntent:oe,motionIntent:oe,interaction:fs.optional(),copyTone:oe,displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(zo).optional(),ctaIntent:oe.optional(),continuityWithPrevious:oe.optional(),avoidRepeating:t.array(oe).max(20).optional(),industryRecipeRefs:t.array(qp).max(12).optional(),templateRecipeRefs:t.array(qp).max(12).optional()}),td=t.object({siteName:t.string().min(1).max(120),tagline:t.string().min(1).max(200).optional(),primaryCta:t.object({label:t.string().min(1).max(60),target:t.string().min(1).max(200)}).optional(),trustSignals:t.array(t.string().min(1).max(60)).max(6).optional(),industry:t.string().min(1).max(40).optional()}),oT=t.enum(["solid","floating"]),rT=t.enum(["background","card","primary","frosted"]),cT=t.enum(["sticky","hide-on-scroll","static"]),mT=t.enum(["bar","island"]),lT=t.object({variant:oT,surface:rT.optional(),behavior:cT.optional(),shape:mT.optional()}),pT=t.object({form:oe,layoutIntent:oe,scrollBehavior:oe,shell:lT.optional(),avoidPatterns:t.array(oe).max(10).optional()}),dT=t.enum(["background","card","primary","inverse"]),uT=t.object({surface:dT}),_T=t.object({form:oe,composition:oe,shell:uT.optional(),avoidPatterns:t.array(oe).max(10).optional()}),gT=t.object({pattern:oe,intent:oe}),nd=t.object({header:pT,footer:_T,mobileNav:gT}),sd=t.enum(["top","below-hero","footer","none"]),id=t.object({schemaVersion:t.literal(1).default(1),siteDesignContext:Ri,routeCards:t.record(t.string().min(1),Zp),blockContexts:t.record(t.string().min(1),ed),selectedSkillPacks:t.array(Rn).max(3).optional(),branding:td.optional(),chromeDesign:nd.optional(),breadcrumbPlacement:sd.optional()}),zq=t.object({siteDesignContext:Ri.omit({imagePalette:!0}).optional(),routeCards:t.record(t.string().min(1),Zp).optional(),blockContexts:t.record(t.string().min(1),ed.extend({interaction:fs.nullable().optional()})).optional(),branding:td.optional(),chromeDesign:nd.optional()}),We=t.string().trim().min(1),Ho=t.object({id:We,label:t.string().trim().min(1),type:t.string(),variant:t.string().optional(),order:t.number(),props:t.record(t.string(),t.unknown()),meta:t.object({aiGenerated:t.boolean(),userEdited:t.boolean(),lastEditedAt:t.string(),lastEditedBy:t.enum(["ai","user"]),userInstruction:t.string().optional()}).optional()}).strict(),$o=t.string().regex(Gn,"Page slug must be '/' or a lowercase ASCII kebab-case absolute path."),hT=new RegExp(`^/(?:${an}(?:/${an})*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$`),ST=/^(?:#[^\s]*|[a-z][a-z0-9+.-]*:[^\s]+|\/\/[^\s]+)$/i,fT=t.union([t.string().regex(hT),t.string().regex(ST)]),Wp=t.object({label:t.string(),href:fT}).passthrough(),bT=t.object({primaryLinks:t.array(Wp),footerLinks:t.array(Wp)}),ad=t.object({showInHeader:t.boolean(),showInFooter:t.boolean(),order:t.number()}).strict(),Vo=t.object({id:We,slug:$o,title:t.string().trim().min(1),blocks:t.array(Ho).min(1),navigation:ad,parent_page_id:We.nullable().optional()}).strict(),yT=Ho.extend({type:t.string().nullable()}).strict(),xT=Vo.extend({slug:$o.nullable(),navigation:ad.extend({showInHeader:t.boolean().nullable(),showInFooter:t.boolean().nullable()}).strict(),blocks:t.array(yT).min(1)}).strict(),ET=Ho.extend({id:t.string()}),RT=Vo.omit({parent_page_id:!0}).extend({id:t.string(),slug:t.string().min(1),blocks:t.array(ET).min(1),parent_page_id:t.string().nullable().optional()}),Bp=t.object({label:t.string(),href:t.string().min(1)}),IT=t.object({primaryLinks:t.array(Bp),footerLinks:t.array(Bp)}),TT=t.discriminatedUnion("kind",[t.object({kind:t.literal("brief_clarify"),brief_id:Zt,answer_ids:t.array(t.string().min(1)).max(10)}).strict(),t.object({kind:t.literal("step5_strategy"),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/)}).strict()]),Ti=t.object({site_name:t.string().min(1).max(80).optional(),version:t.number().int().positive(),pages:t.array(Vo).min(1),navigation:bT,integrations:t.object({cms:t.unknown().optional(),analytics:t.unknown().optional()}).optional(),meta:t.object({generatedAt:t.string(),generatedBy:t.literal("sitemap-agent"),source_brief_id:t.string().optional(),source_answer_ids:t.array(t.string()).optional(),source:TT.optional()}),skillSelection:Rn,visualTheme:nT.optional(),userChoices:t.array(sT).optional(),confirmedChoices:t.object({conversion:Gt.optional()}).optional(),seoKeywords:t.array(jn).min(1).optional()}).strict(),In=Ti.superRefine((e,n)=>{od(e.pages,n)}),bn=Ti.extend({pages:t.array(xT).min(1)}).strict().superRefine((e,n)=>{od(e.pages,n)}),kT=t.enum(["slug","showInHeader","showInFooter"]),AT=t.object({page_id:We,fields:t.array(kT).min(1).max(3)}).strict(),wT=t.object({page_id:We,block_id:We,fields:t.tuple([t.literal("type")])}).strict(),PT=100,CT=500,vT=t.object({pages:t.array(AT).max(PT),blocks:t.array(wT).max(CT)}).strict().superRefine((e,n)=>{let s=new Set;e.pages.forEach((a,o)=>{s.has(a.page_id)&&n.addIssue({code:"custom",path:["pages",o,"page_id"],message:`Duplicate page target '${a.page_id}'.`}),s.add(a.page_id),new Set(a.fields).size!==a.fields.length&&n.addIssue({code:"custom",path:["pages",o,"fields"],message:"Page target fields must be unique."})});let i=new Set;e.blocks.forEach((a,o)=>{let c=`${a.page_id}\0${a.block_id}`;i.has(c)&&n.addIssue({code:"custom",path:["blocks",o],message:`Duplicate block target '${a.page_id}/${a.block_id}'.`}),i.add(c)})}),Hq=t.object({sitemap:bn,targets:vT,reserved_slugs:t.array($o).optional()}).strict(),$q=t.object({sitemap:In}).strict();function od(e,n){let s=new Map,i=new Map,a=new Map,o=0;e.forEach((m,x)=>{let _=s.get(m.id);if(_!==void 0?n.addIssue({code:"custom",path:["pages",x,"id"],message:`Duplicate page id '${m.id}' (first used at pages.${_}.id).`}):s.set(m.id,x),m.blocks.forEach((K,H)=>{let se=i.get(K.id);se!==void 0?n.addIssue({code:"custom",path:["pages",x,"blocks",H,"id"],message:`Duplicate block id '${K.id}' (first used at pages.${se.pageIndex}.blocks.${se.blockIndex}.id).`}):i.set(K.id,{pageIndex:x,blockIndex:H})}),m.slug===null)return;m.slug==="/"&&(o+=1);let P=a.get(m.slug);P!==void 0?n.addIssue({code:"custom",path:["pages",x,"slug"],message:`Duplicate page slug '${m.slug}' (first used at pages.${P}.slug).`}):a.set(m.slug,x)}),(o!==1||e[0]?.slug!=="/")&&n.addIssue({code:"custom",path:["pages"],message:"Sitemap must contain exactly one home page at pages[0] with slug '/'.",params:{errorCode:Fp}});let c=new Map(e.map((m,x)=>[m.id,{page:m,index:x}])),r=(m,x)=>n.addIssue({code:"custom",path:m,message:x,params:{errorCode:Fp}});e.forEach((m,x)=>{let _=m.parent_page_id??null;if(_===null)return;let P=["pages",x,"parent_page_id"];if(m.slug==="/"){r(P,"The home page cannot have a parent.");return}if(_===m.id){r(P,`Page '${m.id}' cannot be its own parent.`);return}let K=c.get(_);if(!K){r(P,`Parent page '${_}' does not exist.`);return}if(K.page.slug==="/"){r(P,"The home page cannot have sub pages.");return}(K.page.parent_page_id??null)!==null&&r(P,`Sitemap allows at most two levels; parent '${_}' must be a top-level page.`)})}var Vq=Ti.omit({skillSelection:!0,visualTheme:!0,userChoices:!0,confirmedChoices:!0,seoKeywords:!0}).extend({meta:Ti.shape.meta.omit({source:!0}),site_name:t.string().min(1).max(80),pages:t.array(RT).min(1),navigation:IT}),DT=t.enum(["ai","user"]),Tn=t.object({site_id:k,page_id:We,edited_by:DT.default("ai"),source_agent_run_id:V.optional()}),Yq=Tn.extend({block_id:We,target_index:t.number().int().min(0)}),OT=Tn.extend({block_id:We}),NT=Tn.extend({block_id:We,instruction:t.string()}),Xq=Tn.extend({block_id:We,variant:t.string().min(1).nullable()}),Qq=Tn.extend({block_id:We,props:t.record(t.string(),t.unknown()),mode:t.enum(["replace","merge"]).default("replace")}),Zq=Tn.extend({block:t.object({id:We,label:t.string().trim().min(1),type:t.string().min(1),variant:t.string().min(1).optional(),props:t.record(t.string(),t.unknown()).default({}),insert_index:t.number().int().min(0).optional()})}),jT=t.enum(["move_block","delete_block","update_block_instruction","change_block_variant","update_block_props","add_block"]),Jq=t.discriminatedUnion("operation",[t.object({operation:t.literal("delete_block"),input:OT}).strict(),t.object({operation:t.literal("update_block_instruction"),input:NT}).strict()]),LT=t.enum(["SITEMAP_EDIT_INVALID","SITEMAP_API_NOT_CONFIGURED","SITEMAP_NOT_FOUND","SITEMAP_PAGE_NOT_FOUND","SITEMAP_BLOCK_NOT_FOUND","SITEMAP_BLOCK_ALREADY_EXISTS","SITEMAP_LAST_BLOCK_DELETE_FORBIDDEN","SITEMAP_EDIT_FAILED"]),MT=t.object({status:t.literal("updated"),operation:jT,site_id:k,sitemap_id:we,version:t.number().int().positive(),changed_pages:t.array(We).min(1),requires_code_patch:t.literal(!0)}),UT=t.object({status:t.literal("failed"),code:LT,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),e2=t.discriminatedUnion("status",[MT,UT]),Yo=t.object({question_id:t.string().min(1),value:t.string().min(1),label:t.string().min(1).optional(),question:t.string().min(1).optional(),option_label:t.string().min(1).optional(),motion_level:Go.optional(),visual_tonality:Fo.optional(),conversion:Gt.optional(),positioning:t.object({market:t.string().min(1).max(200),customer:t.string().min(1).max(200),purpose:t.string().min(1).max(60)}).optional()}),FT=t.object({id:t.string().trim().min(1).max(128),type:t.literal(1),search_intent:t.string().trim().min(1).max(255),path:t.string().trim().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),channel:t.string().trim().min(1).max(80),content_format:t.string().trim().min(1).max(80),priority:t.enum(["P0","P1","P2","P3"])}).strict(),t2=t.object({source:t.object({kind:t.literal("step5_strategy")}).strict()}).strict(),GT=t.object({item_key:vs,title:t.string().trim().min(1).max(200),selected_option_id:Mn,selected_label:t.string().trim().min(1).max(200),selected_value:t.string().trim().min(1).max(500),selected_description:t.string().trim().min(1).max(2e3),impact:t.string().trim().min(1).max(500).optional(),customer_note:t.string().trim().min(1).max(200).optional(),market_type:Ds.optional(),markets:t.array(Os).max(32).optional(),promoted_businesses:Ns.optional(),sections:t.array(t.object({id:t.string().min(1),label:t.string().min(1)}).strict()).optional()}).strict().superRefine((e,n)=>{e.item_key==="product"&&!e.promoted_businesses&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"The product sitemap decision requires ordered promoted businesses."}),e.item_key!=="product"&&e.promoted_businesses!==void 0&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"Promoted businesses are only valid for the product sitemap decision."})}),qT=t.object({kind:t.literal("step5_strategy"),site_name:t.string().trim().min(1).max(80).optional(),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/),decisions:t.array(GT).min(Ps).max(je),enterprise_keywords:t.array(jn).min(1).optional()}).strict().superRefine((e,n)=>{let s=e.decisions.map(a=>a.item_key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 sitemap decisions must use unique strategy keys."}),Ln.forEach(a=>{s.includes(a)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 sitemap decisions are missing ${a}.`})});let i=nn.filter(a=>s.includes(a));e.decisions.forEach((a,o)=>{a.item_key!==i[o]&&n.addIssue({code:"custom",path:["decisions",o,"item_key"],message:"Step5 sitemap decisions must use the canonical order."})})}),rd=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Zt,brief:t.string().min(20).max(1e3),answers:t.array(Yo).min(1).max(10),skillSelection:Rn,site_default_locale:Te.optional(),owner_locale:Te.optional(),cms_site_id:t.string().min(1).nullish(),intent_pages:t.array(FT).max(9).optional(),reference:ys.optional(),input_context:t.object({facts:t.array(bs).max(120),conflicts:t.array(xs).max(20)}).optional(),business_facts:yr.optional(),migration_products_enabled:t.boolean().optional()}),WT=rd.pick({tenant_id:!0,site_id:!0,skillSelection:!0,site_default_locale:!0,owner_locale:!0,cms_site_id:!0,reference:!0,input_context:!0,business_facts:!0,migration_products_enabled:!0}).partial({skillSelection:!0}).extend({source:qT}).strict(),n2=t.union([rd,WT]),cd=t.enum(["planning","generating","validating","ready"]),BT=t.enum(["salvaged","deterministic_fallback"]),KT=t.enum(["model_exception_settled_prefix","model_exception_safe_root"]),md={outcome:BT.optional(),reason:KT.optional(),attempts:t.number().int().positive().optional()};function ld(e,n){if(e.type!=="sitemap.generated")return;let s=e.outcome!==void 0,i=e.reason!==void 0;s!==i&&n.addIssue({code:"custom",path:[s?"reason":"outcome"],message:"sitemap.generated outcome and reason must be provided together"})}var zT=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:cd,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:we,sitemap:In,...md,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:I.optional(),at:t.string().min(1)})]),s2=zT.superRefine(ld),pd=t.object({id:we,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),source_agent_run_id:V.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}).strict();function dd(e,n){e.version!==e.sitemap.version&&n.addIssue({code:"custom",path:["sitemap","version"],message:`Sitemap JSON version ${e.sitemap.version} must equal record version ${e.version}.`})}var ud=pd.extend({sitemap:In}).superRefine(dd),_d=pd.extend({sitemap:bn}).superRefine(dd),i2=t.object({sitemap_id:we,creation_key:t.string().min(1),sitemap:bn,expected_current_sitemap_id:we,expected_current_sitemap_version:t.number().int().positive()}).strict().superRefine((e,n)=>{e.sitemap.version!==e.expected_current_sitemap_version&&n.addIssue({code:"custom",path:["sitemap","version"],message:"Draft version must match the expected base version."})}),a2=t.object({sitemap:_d}).strict();function o2(e){return`sitemap-user-draft:${e.site_id}:${e.expected_current_sitemap_id}:${e.expected_current_sitemap_version}:${e.sitemap_id}`}var r2=t.object({sitemap_id:we,creation_key:t.string().min(1),sitemap:In,source_agent_run_id:V.optional()}),c2=t.object({sitemap_id:we,creation_key:t.string().min(1),sitemap:bn,expected_current_sitemap_id:we,expected_current_sitemap_version:t.number().int().positive(),migration_content_requested:t.boolean().optional()}),m2=t.object({sitemap_id:we,creation_key:t.string().min(1),sitemap:In,source_agent_run_id:V}),l2=t.object({site:Ut,sitemap:ud,next_step:t.literal("workspace")}).strict(),p2=t.object({site:Ut,sitemap:_d,next_step:t.literal("workspace")}).strict(),d2=t.object({site:Ut,sitemap:ud,next_step:t.literal("sitemap_review")}).strict(),HT=t.object({id:nr,tenant_id:t.string().min(1),site_id:k,brief_id:Zt,questions:qo,answers:t.array(Yo),selected_archetype:Rn.optional(),completed_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),u2=t.object({answers:t.array(Yo).min(1),questions:qo,selected_archetype:Rn.optional()}),_2=t.object({clarify_session:HT}),g2=t.object({questions:qo,selected_archetype:Rn}),$T=t.object({id:Ci,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),design_plan:id,source_agent_run_id:V.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),h2=t.object({design_plan_id:Ci.optional(),design_plan:id,source_agent_run_id:V.optional()}),S2=t.object({design_plan:$T}),Pi=t.enum(["initial_generation","iteration","landing_page","fill_in"]),VT=t.object({label:t.string().min(1).max(48),prompt:t.string().min(1).max(160)}).strict(),YT=t.enum(["model","derived","mixed","advisor"]),gd=t.object({suggestions:t.array(VT).min(1).max(4),source:YT}).strict(),XT=t.enum(["clean","salvaged","deterministic_fallback","baseline_retained"]),QT=t.enum(["generation_succeeded","entry_slots_omitted","quality_gate_exhausted","schema_gate_exhausted","generation_timeout","stream_schema_mismatch","stream_generation_error","generation_error","fallback_compiler_error","legacy_result_missing_metadata"]),ZT=t.enum(["progress","assistant_final"]),hd=t.enum(["run.started","message.delta","user.message","plan.updated","clarify.partial","clarify.archetype_proposals","clarify.finished","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","sitemap.updated","sitemap.resync.failed","sitemap.resync.warning","block.changed","tool.started","tool.finished","workspace.plan.created","workspace.worker.updated","workspace.task.updated","workspace.degraded","workspace.design_plan.outcome","workspace.suggestions","workspace.generation_ledger","file.changed","snapshot.created","snapshot.finalized","preview.preparing","preview.ready","preview.build.started","preview.build.succeeded","preview.build.failed","run.failed","run.finished","media_resolution.started","media_resolution.finished","skill.selecting","skill.selected","activity.started","activity.updated","activity.finished","activity.failed"]),JT=t.object({id:t.string().min(1),title:t.string().min(1),status:t.enum(["pending","running","completed","failed"])}),Qt=t.enum(["pending","running","completed","completed_with_skips","failed","skipped"]),Xo=t.enum(["style_media","chrome","sections","layout","pages","detect_typecheck","repair","finalize","sitemap_resync","preview"]),Qo=t.object({code:t.string().min(1),message:t.string().min(1),path:t.string().min(1).optional(),task_id:t.string().min(1).optional(),details:t.record(t.string(),t.unknown()).optional()}),Oe=t.string().min(1).refine(e=>Pd(e),{message:"Snapshot file paths must be safe relative POSIX paths without traversal."}),Zo=t.object({deduped_paths:t.array(Oe),skipped_tasks:t.array(t.string().min(1)),failed_tasks:t.array(t.string().min(1)),fallback_files:t.array(t.string().min(1)),applied_paths:t.array(Oe)}),Jo=t.object({group_id:t.string().min(1),phase:Xo,title:t.string().min(1),status:Qt,task_ids:t.array(t.string().min(1)),depends_on_groups:t.array(t.string().min(1)),target_paths:t.array(Oe)}),ek=t.enum(["style","media","chrome","section","layout","page","breadcrumb"]),er=t.object({task_id:t.string().min(1),group_id:t.string().min(1),kind:ek,target_path:Oe,block_id:t.string().min(1).optional(),block_type:t.string().min(1).optional(),block_variant:t.string().min(1).optional(),block_order:t.number().int().nonnegative().optional(),user_instruction:t.string().min(1).optional(),page_id:t.string().min(1).optional(),page_slug:t.string().min(1).optional(),page_title:t.string().min(1).optional(),title:t.string().min(1).max(60).optional(),description:t.string().min(1).max(zo).optional(),status:Qt,required_reads:t.array(Oe).optional(),search_params_sections:t.array(Oe).optional(),standard_form_view:Oe.optional(),breadcrumb:t.object({trail:t.array(t.object({name:t.string().min(1),href:t.string().min(1).nullable(),omitted_href:t.string().min(1).optional()}).strict()).min(1),current:t.string().min(1),placement:sd.optional()}).strict().optional()}),tr=t.object({from_group_id:t.string().min(1),to_group_id:t.string().min(1),reason:t.enum(["style_media","chrome","sections","layout","page_composition","quality_gate"])}),f2=t.object({plan_id:t.string().min(1),run_kind:Pi,model_route:t.object({planner:t.literal("workspace_planner"),worker:t.literal("workspace")}),groups:t.array(Jo),tasks:t.array(er),dependencies:t.array(tr),expected_outputs:t.array(Oe),diagnostics:Zo}),b2=t.object({task_id:t.string().min(1),patch:t.unknown().optional(),snapshot_id:I.optional(),read_files:t.array(Oe),diagnostics:t.array(Qo),status:Qt}),Sd=t.object({worker_count:t.number().int().nonnegative(),task_count:t.number().int().nonnegative(),group_count:t.number().int().nonnegative()}),fd=t.object({pending:t.number().int().nonnegative(),running:t.number().int().nonnegative(),completed:t.number().int().nonnegative(),completed_with_skips:t.number().int().nonnegative(),failed:t.number().int().nonnegative(),skipped:t.number().int().nonnegative()}),tk=t.object({type:t.literal("text"),text:t.string(),state:t.enum(["streaming","done"]).optional()}),nk=t.object({type:t.literal("reasoning"),text:t.string(),state:t.enum(["streaming","done"]).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),sk=t.object({type:t.literal("file"),mediaType:t.string().min(1),filename:t.string().min(1).optional(),url:t.string().min(1)}),ik=t.object({type:t.literal("source-url"),sourceId:t.string().min(1),url:t.string().min(1),title:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),ak=t.object({type:t.literal("source-document"),sourceId:t.string().min(1),mediaType:t.string().min(1),title:t.string().min(1),filename:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),ok=t.object({type:t.string().regex(/^data-[a-zA-Z0-9_-]+$/),id:t.string().min(1).optional(),data:t.unknown()}),rk=t.object({type:t.string().regex(/^tool-[a-zA-Z0-9_-]+$/),toolCallId:t.string().min(1),state:t.enum(["input-streaming","input-available","output-available","output-error"]),input:t.unknown().optional(),output:t.unknown().optional(),errorText:t.string().min(1).optional()}),ck=t.object({type:t.literal("error"),errorText:t.string().min(1)}),mk=t.object({type:t.literal("step-start")}),ki=t.union([tk,nk,sk,ik,ak,ok,rk,ck,mk]),lk=t.string().min(1).max(512).refine(e=>Pd(e)&&!/^[A-Za-z]:\//.test(e),{message:"Generated-code rescue paths must be safe relative POSIX paths without traversal."}),pk=t.array(lk).min(1).max(64),dk=t.array(t.string().min(1).max(120)).min(1).max(64),bd=t.discriminatedUnion("outcome",[t.object({outcome:t.literal("full_success"),page_copy:Us.optional(),navigation:t.discriminatedUnion("status",[t.object({status:t.literal("not_requested")}).strict(),t.object({status:t.literal("succeeded")}).strict()])}).strict(),t.object({outcome:t.literal("partial_success"),page_copy:Us.optional(),navigation:t.object({status:t.literal("failed"),error_code:t.string().min(1).max(120),message:t.string().min(1).max(360)}).strict()}).strict()]).describe("Typed completion details for a committed Workspace Resource Run."),uk=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("message.delta"),text:t.string().min(1),history_purpose:ZT.optional(),at:t.string().min(1)}),t.object({type:t.literal("user.message"),client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(ki).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Gs.optional(),at:t.string().min(1)}),t.object({type:t.literal("plan.updated"),steps:t.array(JT),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Kp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:cd,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:we,sitemap:In,...md,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("sitemap.updated"),sitemap_id:we,version:t.number().int().positive(),reason:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.failed"),error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.warning"),code:t.string().min(1),message:t.string().min(1),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("block.changed"),block_id:t.string().min(1),change_type:t.enum(["add","update","delete","move"]),at:t.string().min(1)}),t.object({type:t.literal("tool.started"),tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("tool.finished"),tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:ba.optional(),interaction_failure:fa.optional(),at:t.string().min(1)}),t.object({type:t.literal("workspace.plan.created"),plan_id:t.string().min(1),run_kind:Pi,groups:t.array(Jo),tasks:t.array(er),dependencies:t.array(tr),expected_outputs:t.array(Oe),diagnostics:Zo,summary:Sd,at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.worker.updated"),group_id:t.string().min(1),phase:Xo,status:Qt,task_counts:fd,target_paths:t.array(Oe),diagnostics:t.array(t.string().min(1)),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.task.updated"),task_id:t.string().min(1),group_id:t.string().min(1),status:Qt,target_path:Oe,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(Qo).optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.degraded"),reason:t.enum(["block_placeholder","form_placeholder","patch_protected_dropped","preview_health_degraded","preview_build_failed","design_plan_fallback","generated_code_rescue","cms_page_directory_degraded","form_prebuild_skipped","form_section_fallback","first_settings_sync_failed","component_omitted","page_omitted","shared_fallback"]),degraded_block_ids:t.array(t.string().min(1)).min(1).optional(),dropped_files:t.array(t.string().min(1)).min(1).optional(),degraded_file_paths:pk.optional(),degraded_page_ids:dk.optional(),snapshot_id:I.optional(),code:t.string().min(1).optional(),message:t.string().min(1).optional(),diagnostics:t.string().min(1).optional(),retryable:t.boolean().optional(),at:t.string().min(1)}).strict().superRefine((e,n)=>{let s=e.reason==="generated_code_rescue",i=e.reason==="page_omitted",a=e.reason==="shared_fallback";if(!s){if(e.degraded_file_paths!==void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"degraded_file_paths is only allowed for generated_code_rescue"}),e.degraded_page_ids!==void 0&&!i&&n.addIssue({code:"custom",path:["degraded_page_ids"],message:"degraded_page_ids is only allowed for generated_code_rescue or page_omitted"}),a)for(let o of["degraded_block_ids","dropped_files","snapshot_id","code","diagnostics","retryable"])e[o]!==void 0&&n.addIssue({code:"custom",path:[o],message:`${o} is not allowed for shared_fallback`});return}e.degraded_file_paths===void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"generated_code_rescue requires degraded_file_paths"});for(let o of["degraded_block_ids","dropped_files","snapshot_id","code","message","diagnostics","retryable"])e[o]!==void 0&&n.addIssue({code:"custom",path:[o],message:`${o} is not allowed for generated_code_rescue`})}),t.object({type:t.literal("workspace.design_plan.outcome"),design_plan_outcome:XT,reason:QT,gate_diagnostics:t.object({gate:t.enum(["quality","schema"]),issue_codes:t.array(t.string().min(1)).max(20),issue_paths:t.array(t.string()).max(20),finish_reason:t.string().min(1).optional()}).strict().optional(),media_floor:t.object({total_blocks:t.number().int().min(0),media_bearing_blocks:t.number().int().min(0),hero_total:t.number().int().min(0),hero_media_bearing:t.number().int().min(0),pages_without_media:t.array(t.string().min(1)).max(50),met:t.boolean()}).strict().optional(),at:t.string().min(1)}).strict(),gd.extend({type:t.literal("workspace.suggestions"),at:t.string().min(1)}).strict(),Rr,t.object({type:t.literal("file.changed"),path:t.string().min(1),change_type:t.enum(["create","update","delete"]),diff:t.string().optional(),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("snapshot.finalized"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.preparing"),at:t.string().min(1)}),t.object({type:t.literal("preview.ready"),url:t.string().url(),at:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({type:t.literal("preview.build.started"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.build.succeeded"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.build.failed"),snapshot_id:I,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:zp.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:I.optional(),degraded_reason:Pn.optional(),build_verified:t.boolean().optional(),generation_ledger:On.optional(),resource_operation:bd.optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().datetime()}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().datetime()}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("activity.started"),activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:Jp,title:t.string().min(1).max(200),detail:t.string().max(360).optional(),title_code:Mt.optional(),detail_code:Mt.optional(),locks_input:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("activity.updated"),activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),detail:t.string().max(360).optional(),title_code:Mt.optional(),detail_code:Mt.optional(),at:t.string().min(1)}),t.object({type:t.literal("activity.finished"),activity_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("activity.failed"),activity_id:t.string().min(1),detail:t.string().max(360).optional(),at:t.string().min(1)})]),yd=uk.superRefine(ld).superRefine((e,n)=>{if(e.type==="user.message"&&e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type==="run.finished"&&e.resource_operation&&!e.snapshot_id&&n.addIssue({code:"custom",path:["snapshot_id"],message:"resource_operation requires a confirmed snapshot_id"}),e.type!=="tool.finished")return;let s=e.name==="prepare_product_search_entry",i=!!e.interaction_request,a=!!e.interaction_failure;(s?i!==a:!i&&!a)||n.addIssue({code:"custom",path:["interaction_request"],message:s?"prepare_product_search_entry requires exactly one of interaction_request or interaction_failure":"product search interaction results are only valid for prepare_product_search_entry"})}),Uo=t.object({id:ir,tenant_id:t.string().min(1),site_id:k,agent_run_id:V,sequence:t.number().int().positive(),event_type:hd,payload:yd,created_at:t.string().min(1),thread_id:at.nullable().optional()}),y2=t.object({event_type:hd,payload:yd}).superRefine((e,n)=>{e.event_type!==e.payload.type&&n.addIssue({code:"custom",path:["payload","type"],message:"payload.type must match event_type"}),us(e.payload)&&n.addIssue({code:"custom",path:["payload"],message:"AgentEvent payload must not contain secrets"})}),x2=t.discriminatedUnion("status",[t.object({status:t.literal("appended"),agent_run:it,event:Uo,next_cursor:t.number().int().nonnegative()}),t.object({status:t.literal("duplicate_ignored"),agent_run:it,event:Uo,next_cursor:t.number().int().nonnegative()})]),E2=t.object({events:t.array(Uo),next_cursor:t.number().int().nonnegative().optional()}),R2=t.object({after_sequence:t.coerce.number().int().nonnegative().default(0)}),I2=t.object({run_id:V.optional(),thread_id:at.optional()}).superRefine((e,n)=>{e.run_id&&e.thread_id&&n.addIssue({code:"custom",path:["thread_id"],message:"run_id and thread_id are mutually exclusive"})}),T2=t.enum(["implemented","skeleton","planned"]),k2=t.enum(["GET","POST","PUT","PATCH","DELETE"]),A2=[{method:"PATCH",path:"/internal/sites/:site_id/snapshots/:snapshot_id/manifest",tag:"snapshots",summary:"Compare-and-set the manifest hash for the active current snapshot after an in-place object replacement.",status:"implemented",request_body_schema:"UpdateCurrentSnapshotManifestRequestSchema",response_schema:"SnapshotRecordSchema",notes:["Internal Agent authentication is required. The update succeeds only when site current_snapshot_id, snapshot status, object key, and expected manifest hash still match."]},{method:"GET",path:"/health",tag:"system",summary:"API health check.",status:"implemented",response_schema:"ApiHealth"},{method:"POST",path:"/sites",tag:"sites",summary:"Create a site and Step 1 brief in the current dev context.",status:"implemented",request_body_schema:"CreateSiteBriefRequestSchema",response_schema:"CreateSiteBriefResponseSchema"},{method:"POST",path:"/sites/drafts",tag:"sites",summary:"Create a draft site without a brief in the current tenant so /s/:site_id can collect Step 1 later.",status:"implemented",request_body_schema:"CreateSiteDraftRequestSchema",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites",tag:"sites",summary:"List current tenant sites.",status:"implemented",response_schema:"SiteRecordSchema[]"},{method:"GET",path:"/sites/by-cms/:cms_site_id",tag:"sites",summary:"Resolve an external CMS site id to one tenant-scoped VCP site.",status:"implemented",response_schema:"SiteRecordSchema",notes:["Used by the browser /d/:cms_site_id handoff route; lookup is scoped by current request tenant and returns 404 when the CMS site has not been synchronized."]},{method:"GET",path:"/sites/:site_id",tag:"sites",summary:"Get one tenant-scoped site.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"POST",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Create one version-bound site workflow from a published flow definition.",status:"implemented",request_body_schema:"CreateSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Read the current site workflow snapshot and derived menu state.",status:"implemented",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/workflow/progress",tag:"site-workflows",summary:"Read the minimal internal site workflow progress projection.",status:"implemented",response_schema:"SiteWorkflowProgressResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/website",tag:"site-workflows",summary:"Update the source website while website_scan is current.",status:"implemented",request_body_schema:"UpdateSiteWorkflowWebsiteRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/advance",tag:"site-workflows",summary:"Advance one non-terminal workflow node with an expected-current-node guard.",status:"implemented",request_body_schema:"AdvanceSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/complete",tag:"site-workflows",summary:"Complete the workflow from its final publishing node after server-side release checks pass.",status:"implemented",request_body_schema:"CompleteSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The browser supplies only the expected current node; the server verifies persisted release facts before completing the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/complete-quality-only",tag:"site-workflows",summary:"Complete the designer workflow after the linked quality-only publish workflow succeeds.",status:"implemented",request_body_schema:"CompleteQualityOnlyWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The server resolves the designer role and atomically completes both workflows without creating a publish deployment or updating the site deployment projection."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/register",tag:"site-workflows",summary:"Register a business-owned external task id and its idempotency key.",status:"implemented",request_body_schema:"RegisterWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/step2-site-initialization/tasks",tag:"site-workflows/step2-site-initialization",summary:"Create or reuse the current workflow's Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The server derives tenantId, sessionId, and siteUrl from trusted request/workflow state; the browser cannot submit upstream scope fields."]},{method:"GET",path:"/sites/:site_id/workflow/step2-site-initialization/tasks/:task_id",tag:"site-workflows/step2-site-initialization",summary:"Poll the workflow-owned Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The task id must match the current non-superseded website_crawl task reference for the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/:task_type/replace",tag:"site-workflows",summary:"Replace one task reference while retaining its superseded history.",status:"implemented",request_body_schema:"ReplaceWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/tasks/website_crawl/replace-and-invalidate-dependents",tag:"site-workflows",summary:"Replace website crawl and invalidate basic-info and metrics dependents atomically.",status:"implemented",request_body_schema:"ReplaceCrawlWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/build",tag:"site-workflows",summary:"Start the server-owned site build and workspace snapshot lifecycle.",status:"implemented",request_body_schema:"StartSiteBuildRequestSchema",response_schema:"StartSiteBuildResponseSchema",notes:["The browser may start or query the build, but cannot write site build or deployment summary status directly."]},{method:"GET",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Read the persisted no-website customer materials draft.",status:"implemented",response_schema:"CustomerMaterialsNullableResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Save the no-website customer materials before submission.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["A submitted record is immutable and rejects later writes."]},{method:"POST",path:"/sites/:site_id/workflow/customer-materials/submit",tag:"site-workflows",summary:"Submit and freeze customer materials before analysis.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["Repeated submissions return 409; clients may retry only the separate workflow advance."]},{method:"GET",path:"/sites/:site_id/designer/component-library/categories",tag:"designer-component-library",summary:"List the fixed insert-new-component category tree for a site.",status:"implemented",response_schema:"ListDesignerComponentCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewComponent."]},{method:"GET",path:"/sites/:site_id/designer/component-library/resources",tag:"designer-component-library",summary:"List component resources from the fixed designer catalog group.",status:"implemented",query_schema:"ListDesignerComponentsQuerySchema",response_schema:"ListDesignerComponentsResponseSchema",notes:["The server fixes resource type to component and does not expose resource-platform secrets, internal hosts, or product-line selection."]},{method:"POST",path:"/sites/:site_id/designer/component-library/resources/:resource_id/install",tag:"designer-component-library",summary:"Install one exact component version and return a strict SiteEditEngine materialization.",status:"implemented",request_body_schema:"InstallDesignerComponentBodySchema",response_schema:"InstallDesignerComponentResponseSchema",notes:["The server downloads the resource ZIP with the configured secret, validates main.json identity and compatibility, and returns only the strict materialization plus immutable revision metadata."]},{method:"GET",path:"/sites/:site_id/designer/page-library/categories",tag:"designer-page-library",summary:"List the fixed insert-new-page category tree for a site.",status:"implemented",response_schema:"ListDesignerPageCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewPage."]},{method:"GET",path:"/sites/:site_id/designer/page-library/resources",tag:"designer-page-library",summary:"List page and pages resources from the fixed designer catalog.",status:"implemented",query_schema:"ListDesignerPagesQuerySchema",response_schema:"ListDesignerPagesResponseSchema",notes:["The server fixes resource types to page and pages and does not expose resource-platform credentials or internal routing."]},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/prepare",tag:"designer-page-library",summary:"Resolve one exact page resource version for designer-side draft configuration.",status:"implemented",request_body_schema:"PrepareDesignerPageBodySchema",response_schema:"PrepareDesignerPageResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/install",tag:"designer-page-library",summary:"Install one exact page resource version and return a strict PageResourceArtifact.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server validates the explicit resource type, immutable package identity, page selections, materializations, and package-local references."]},{method:"GET",path:"/sites/:site_id/designer/pages",tag:"designer-page-library",summary:"List designer pages from the stable first-phase fixture source.",status:"implemented",response_schema:"ListDesignerSitePagesResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/enhance",tag:"designer-page-library",summary:"Echo a designer page-resource candidate without model execution or normalization.",status:"implemented",request_body_schema:"EnhanceDesignerPageResourceBodySchema",response_schema:"EnhanceDesignerPageResourceResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/compose",tag:"designer-page-library",summary:"Compose exact page and component resources into one strict page artifact.",status:"implemented",request_body_schema:"ComposeDesignerPageResourceBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server installs every immutable source, validates ordered page blocks, scopes component materializations, and returns one artifact without exposing resource-platform credentials."]},{method:"POST",path:"/sites/:site_id/designer/page-resources/blank",tag:"designer-page-library",summary:"Create the deterministic built-in blank page artifact for one configured route.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema"},{method:"PATCH",path:"/sites/:site_id",tag:"sites",summary:"Update site display name and optional generated-site locale for the current tenant.",status:"implemented",request_body_schema:"UpdateSiteRequestSchema",response_schema:"SiteRecordSchema"},{method:"DELETE",path:"/sites/:site_id",tag:"sites",summary:"Archive a site so it no longer appears in the tenant site list.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites/:site_id/workspace/source-files",tag:"sites",summary:"List source files available in the ready preview sandbox.",status:"implemented",response_schema:"WorkspaceSourceFileListItemSchema[]"},{method:"GET",path:"/sites/:site_id/workspace/source-file",tag:"sites",summary:"Read a source file from the ready preview sandbox.",status:"implemented",query_schema:"WorkspaceSourceFilePathQuerySchema",response_schema:"WorkspaceSourceFileResponseSchema"},{method:"GET",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"List or search enterprise image assets through the CMS adapter.",status:"implemented",query_schema:"ListMediaLibraryAssetsQuerySchema",response_schema:"ListMediaLibraryAssetsResponseSchema"},{method:"POST",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"Upload one validated image and create its enterprise asset.",status:"implemented",response_schema:"UploadMediaLibraryAssetResponseSchema",notes:["Accepts one multipart field named file; only the image MIME allowlist is accepted and the maximum size is 20 MiB."]},{method:"GET",path:"/sites/:site_id/media-assets/unsplash/search",tag:"media-assets",summary:"Search Unsplash through the VCP server-side client.",status:"implemented",query_schema:"SearchUnsplashMediaQuerySchema",response_schema:"SearchUnsplashMediaResponseSchema",notes:["The browser never receives the Unsplash access key; CMS is not involved in search."]},{method:"POST",path:"/sites/:site_id/media-assets/unsplash/:provider_id/use",tag:"media-assets",summary:"Best-effort report that an Unsplash image was selected.",status:"implemented",request_body_schema:"UseUnsplashMediaRequestSchema",response_schema:"UseUnsplashMediaResponseSchema",notes:["CMS report failure returns reported=false and does not roll back the image replacement."]},{method:"POST",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Confirm the currently reviewed Sitemap Draft and advance the site to structure_saved.",status:"implemented",request_body_schema:"ConfirmSiteStructureRequestSchema",response_schema:"PersistSiteSitemapDraftResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/sitemap-draft",tag:"sitemaps",summary:"Persist an agent-generated sitemap draft without confirming the structure.",status:"implemented",request_body_schema:"PersistGeneratedSitemapDraftRequestSchema",response_schema:"PersistGeneratedSitemapDraftResponseSchema"},{method:"PUT",path:"/sites/:site_id/sitemap/draft",tag:"sitemaps",summary:"Save an immutable user draft without confirming or advancing the workflow.",status:"implemented",request_body_schema:"SaveSiteSitemapDraftRequestSchema",response_schema:"SaveSiteSitemapDraftResponseSchema"},{method:"GET",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Read the current Sitemap Draft for a site.",status:"implemented",response_schema:"SitemapDraftRecordSchema"},{method:"POST",path:"/sites/:site_id/clarify/answers",tag:"clarify",summary:"Persist the Step 2 clarify answers (and the answered questions) into the site's clarify session.",status:"implemented",request_body_schema:"PersistClarifyAnswersRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema"},{method:"PATCH",path:"/sites/:site_id/clarify/archetype",tag:"clarify",summary:"Switch the Step 2 industry archetype (user_picked) into the site's clarify session via an idempotent upsert.",status:"implemented",request_body_schema:"UpdateClarifyArchetypeRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema",notes:["Independent of generate: materializes a clarify_sessions row when none exists (using the supplied questions) or updates only selected_archetype; never writes answers/completed_at. Forces source=user_picked."]},{method:"POST",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Persist a generated design plan version for a site (internal agent-only write).",status:"implemented",request_body_schema:"PersistSiteDesignPlanRequestSchema",response_schema:"PersistSiteDesignPlanResponseSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent writes design plans."]},{method:"GET",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site (internal agent-only read).",status:"implemented",response_schema:"DesignPlanRecordSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent reads design plans."]},{method:"GET",path:"/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site so Workspace UI can inspect the generated design contract.",status:"implemented",response_schema:"DesignPlanRecordSchema"},{method:"GET",path:"/sites/:site_id/brief",tag:"briefs",summary:"Read the persisted Step 1 brief for a site so the Workspace Agent can seed first full-site generation without a new write surface.",status:"implemented",response_schema:"BriefRecordSchema"},{method:"PUT",path:"/sites/:site_id/brief/draft",tag:"briefs",summary:"Save a draft site's Step 1 brief without advancing the workflow.",status:"implemented",request_body_schema:"SaveBriefDraftRequestSchema",response_schema:"SaveBriefDraftResponseSchema",notes:["Only sites in the editable build phase are writable; the brief row is upserted idempotently while site status, locale, and workflow stage remain unchanged."]},{method:"PATCH",path:"/sites/:site_id/brief",tag:"briefs",summary:"Create or update a draft site's Step 1 brief and advance it to Clarify without allowing later workflow states to roll back.",status:"implemented",request_body_schema:"UpdateBriefRequestSchema",response_schema:"UpdateBriefResponseSchema",notes:["Only sites in the editable build phase are writable; missing brief rows are created on first save; identical retries are idempotent."]},{method:"POST",path:"/internal/sites/:cms_site_id/external-sync",tag:"sites",summary:"Synchronize trusted CMS identity by tenant_id + cms_site_id; legacy site_url is optional and ignored. The response URL is the configured public API base or null.",status:"implemented",request_body_schema:"ExternalSyncSiteRequestSchema",response_schema:"ExternalSyncSiteResponseSchema",notes:["This trusted external entry does not require browser login or internal bearer auth; tenant_id is written directly to tenants.id and the response uses the internal { code, data, message } success envelope."]},{method:"POST",path:"/internal/sites/:site_id/page-templates",tag:"page-templates",summary:"Accept 1\u20133 Page Template items as one asynchronous Workspace task (HTTP 202).",status:"implemented",request_body_schema:"PageTemplateCreateRequestSchema",response_schema:"PageTemplateCreateResponseSchema",notes:["Internal bearer plus tenant context; API starts one new background thread/run with its fixed system identity. Poll GET /internal/external-site-edits/:task_id; no external IDs or callbacks. Manifest-gated whole-batch success commits exactly one snapshot."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/promote",tag:"page-templates",summary:"Promote a private page template through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplatePromoteRequestSchema",response_schema:"PageTemplatePromoteResponseSchema",notes:["Internal service endpoint; uses the same bearer + tenant/user context as create and delegates to Agent with API-owned credentials."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/cleanup",tag:"page-templates",summary:"Clean up private page templates through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplateCleanupRequestSchema",response_schema:"PageTemplateCleanupResponseSchema",notes:["Internal service endpoint; cleanup remains explicit and default-template protection is enforced by the Agent lifecycle service."]},{method:"POST",path:"/sites/:site_id/snapshots",tag:"snapshots",summary:"Persist snapshot metadata without changing the current site snapshot.",status:"implemented",request_body_schema:"PersistSiteSnapshotRequestSchema",response_schema:"PersistSiteSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"Promote a site snapshot as the current workspace version.",status:"implemented",request_body_schema:"PromoteSiteSnapshotRequestSchema",response_schema:"PromoteSiteSnapshotResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/try-acquire",tag:"snapshots",summary:"Try to acquire the short-lived template-upgrade site lock.",status:"implemented",request_body_schema:"TryAcquireTemplateUpgradeLockRequestSchema",response_schema:"TryAcquireTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; lock contention returns acquired=false instead of a user-facing conflict."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/release",tag:"snapshots",summary:"Release the calling template-upgrade attempt's site lock.",status:"implemented",request_body_schema:"ReleaseTemplateUpgradeLockRequestSchema",response_schema:"ReleaseTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; release is scoped by tenant, site, operation type, and owner."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"CAS-promote a validated template-upgrade candidate and bind its accepted commit atomically.",status:"implemented",request_body_schema:"PromoteTemplateUpgradeSnapshotRequestSchema",response_schema:"PromoteTemplateUpgradeSnapshotResponseSchema",notes:["Internal agent-only endpoint; accepted_commit is never part of the public promote request or response."]},{method:"GET",path:"/internal/sites/:site_id/template-upgrade/state",tag:"snapshots",summary:"Inspect the projected tenant-scoped template-upgrade state without mutation.",status:"implemented",query_schema:"InspectTemplateUpgradeStateRequestSchema",response_schema:"InspectTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the repository path is read-only."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/prepare",tag:"snapshots",summary:"Prepare the tenant-scoped template-upgrade retry state for a target version.",status:"implemented",request_body_schema:"PrepareTemplateUpgradeStateRequestSchema",response_schema:"PrepareTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/failure",tag:"snapshots",summary:"Record a finite validation failure for the prepared template-upgrade target.",status:"implemented",request_body_schema:"RecordTemplateUpgradeFailureRequestSchema",response_schema:"RecordTemplateUpgradeFailureResponseSchema",notes:["Internal agent-only endpoint; accepts a finite error code and never raw validation output."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/success",tag:"snapshots",summary:"Reset retry state after the prepared template-upgrade target succeeds.",status:"implemented",request_body_schema:"RecordTemplateUpgradeSuccessRequestSchema",response_schema:"RecordTemplateUpgradeSuccessResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/events",tag:"snapshots",summary:"Record one bounded template-upgrade observability event.",status:"implemented",request_body_schema:"RecordTemplateUpgradeEventRequestSchema",response_schema:"RecordTemplateUpgradeEventResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the strict request excludes raw errors, source content, and file paths."]},{method:"GET",path:"/internal/template-upgrades/report",tag:"snapshots",summary:"Read tenant-scoped template-upgrade outcome, state, and duration aggregates.",status:"implemented",query_schema:"GetTemplateUpgradeReportQuerySchema",response_schema:"GetTemplateUpgradeReportResponseSchema",notes:["Internal endpoint; tenant identity is derived from trusted request context and all aggregates are tenant-scoped."]},{method:"GET",path:"/internal/template-upgrades/snapshot-deletions/pending",tag:"snapshots",summary:"List tenant-scoped stale template-upgrade snapshot deletions for dry-run or reconciliation.",status:"implemented",query_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema",response_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema",notes:["Defaults to retrying deleting tombstones. Including candidate snapshots is an explicit maintenance action and should use a conservative age threshold."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/abandon",tag:"snapshots",summary:"Mark an unpromoted candidate snapshot as failed.",status:"implemented",response_schema:"AbandonSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Read one tenant-scoped snapshot metadata record for a site.",status:"implemented",response_schema:"SnapshotRecordSchema"},{method:"DELETE",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Prepare two-phase deletion of a candidate snapshot and return its object key; refuses non-candidate/current/referenced snapshots.",status:"implemented",response_schema:"DeleteSiteSnapshotResponseSchema",notes:["Internal Agent authentication is required. This endpoint only creates a deleting tombstone; object removal and completion are separate steps."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/deletion/complete",tag:"snapshots",summary:"Complete deletion after the snapshot object has been removed; only accepts deleting snapshots.",status:"implemented",response_schema:"CompleteSiteSnapshotDeletionResponseSchema",notes:["Internal Agent authentication is required; callers must remove the object before completing the DB deletion."]},{method:"POST",path:"/agent-runs",tag:"agent-runs",summary:"Create an agent run for event persistence and replay.",status:"implemented",request_body_schema:"CreateAgentRunRequestSchema",response_schema:"CreateAgentRunResponseSchema"},{method:"POST",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Append one normalized AgentEvent to a run.",status:"implemented",request_body_schema:"AppendAgentEventRequestSchema",response_schema:"AppendAgentEventResponseSchema",notes:["Internal-only write surface: only internal-service callers may append, except browser (oidc) contexts may append run.failed (the WS connect-stage unlock path, equivalent to POST /agent-runs/workspace/cancel). All other oidc appends \u2014 run.finished, run.started, tool/system/progress, file/snapshot \u2014 are rejected with 403 FORBIDDEN. The browser sends user messages over the Workspace WebSocket (recorded server-side as user.message) and otherwise only reads the GET replay."]},{method:"GET",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Replay AgentEvents after a run-local sequence cursor.",status:"implemented",response_schema:"ListAgentEventsResponseSchema"},{method:"POST",path:"/agent-runs/workspace/stop",tag:"agent-runs",summary:"Request a soft stop of the active first-generation or fill-in run for a site.",status:"implemented",request_body_schema:"StopWorkspaceGenerationRequestSchema",response_schema:"StopWorkspaceGenerationResponseSchema",notes:["Browser surface with the same tenant scoping as POST /agent-runs/workspace/cancel: only the active initial_generation / fill_in run of a site in the caller's tenant is touched.","A run holding a live lease gets stop_requested_at instead of a terminal event, so it keeps the pages it already saved and closes itself: status=requested, or already_requested on a repeat (the first stop timestamp is never moved).","A run whose lease has lapsed has no process left to honour the flag, so it is closed immediately (run.failed, site lock released) and the answer is status=stopped. Nothing in flight returns no_active_run with run_id null."]},{method:"POST",path:"/internal/agent-runs/fail-stale-in-flight",tag:"agent-runs",summary:"Fail stale in-flight workspace runs (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"FailStaleInFlightWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard (Bearer VCP_AGENT_INTERNAL_TOKEN, production fail-closed); the /internal/** prefix is exempt from browser auth middleware so the guard is the sole trust boundary. Not exposed to the browser via agent-proxy; called by an external admin cron / controlled ops script."]},{method:"POST",path:"/internal/agent-runs/claim-stale-workspace-runs",tag:"agent-runs",summary:"Claim stale workspace runs for resumption (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"ClaimStaleWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard; same trust boundary as fail-stale-in-flight and not exposed to the browser.","Re-issues a fresh lease_owner (fencing token) and increments resume_count in one UPDATE for each resumable initial run; a lease expiring only means the work was interrupted, not that the run failed. Initial runs that used up WORKSPACE_MAX_RESUME_COUNT and interrupted fill-in runs are failed instead and are absent from the response."]},{method:"GET",path:"/internal/agent-runs/:run_id/context",tag:"agent-runs",summary:"Resolve run thread context (internal, Agent Runtime).",status:"implemented",response_schema:"AgentRunContextResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Returns the run together with its thread (null = the site main thread); a run outside the tenant is 404."]},{method:"POST",path:"/internal/agent-runs/:run_id/heartbeat",tag:"agent-runs",summary:"Renew a workspace run lease (internal, Agent Runtime).",status:"implemented",request_body_schema:"WorkspaceRunHeartbeatRequestSchema",response_schema:"WorkspaceRunHeartbeatResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","One CAS UPDATE checks that the run is still in flight and that lease_owner has not been re-issued: superseded means another attempt took over and this process must stop dispatching; not_active means the run already reached a terminal state."]},{method:"POST",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"Register a workspace page checkpoint (internal, Agent Runtime).",status:"implemented",request_body_schema:"RegisterWorkspacePageCheckpointRequestSchema",response_schema:"WorkspacePageCheckpointSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Idempotent on (tenant_id, run_id, page_id, attempt): a conflict returns the existing row unchanged. The object must already be written to storage \u2014 a failed registration means the page was not saved. A lease_owner that no longer matches the run is 409, and a run in a terminal state is 409."]},{method:"GET",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"List workspace page checkpoints (internal, Agent Runtime).",status:"implemented",response_schema:"ListWorkspacePageCheckpointsResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; returns one row per page_id (the highest attempt). A run outside the tenant returns no checkpoints."]},{method:"GET",path:"/internal/agent-runs/:run_id/run-control",tag:"agent-runs",summary:"Read workspace run control input (internal, Agent Runtime).",status:"implemented",response_schema:"WorkspaceRunControlInputResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; AgentRunRecord carries no input, so the lease owner, stop flag, resume count and fill-in inputs stored on the run row are read here. A run outside the tenant, or one that is not a workspace run, is 404."]},{method:"GET",path:"/deployments",tag:"deployments",summary:"Deployment resource summary endpoint until publish APIs land.",status:"skeleton"},{method:"GET",path:"/sites/:site_id/generation-ledger",tag:"sites",summary:"Read the stored generation ledger of a site (omitted deliverables and fill-in progress).",status:"implemented",response_schema:"SiteGenerationLedgerResponseSchema",notes:["One ledger per (tenant_id, site_id), written when an initial_generation / fill_in run.finished carries generation_ledger. A site that has never finished such a run returns ledger null with source_run_id and updated_at null."]},{method:"POST",path:"/sites/:site_id/generation/fill-in",tag:"sites",summary:"Start a fill-in run for deliverables the generation ledger still lists as omitted.",status:"implemented",request_body_schema:"StartFillInRequestSchema",response_schema:"StartFillInResponseSchema",notes:["Every target must still be listed as an unfilled omission in the site ledger; otherwise 400 FILL_IN_TARGET_NOT_OMITTED with details.target_id. A site with no ledger at all is rejected with the same code.","The site must be workspace_ready; otherwise 409 FILL_IN_NOT_AVAILABLE.","A fill-in run does not take the per-site workspace_run operation lock: while it runs the user keeps browsing. client_run_key makes the POST idempotent \u2014 repeating it returns the existing in-flight run and does not dispatch it again; another in-flight workspace run on the same site is rejected with 409 WORKSPACE_RUN_IN_FLIGHT."]},{method:"POST",path:"/sites/:site_id/workspace/runs",tag:"workspace",summary:"Start an asynchronous Workspace Agent run from the current snapshot.",status:"implemented",request_body_schema:"StartWorkspaceRunRequestSchema",response_schema:"StartWorkspaceRunResponseSchema",notes:["Long-running work must be event-driven and must not block API transactions."]},{method:"POST",path:"/sites/:site_id/workspace/attachments",tag:"workspace",summary:"Upload a chat image attachment for the Workspace conversation.",status:"implemented",response_schema:"WorkspaceAttachmentSchema",notes:["multipart/form-data with a single `file`; the response `image_url` is referenced by a `file` part of the next client message."]},{method:"POST",path:"/sites/:site_id/workspace/attachments/from-url",tag:"workspace",summary:"Capture a screenshot of a web page and store it as a chat image attachment.",status:"implemented",request_body_schema:"WorkspaceAttachmentFromUrlRequestSchema",response_schema:"WorkspaceAttachmentSchema",notes:["The screenshot becomes an ordinary attachment: same quotas, same `file` part reference, never placed on the site.","Capture runs through the ingestion service (SSRF guard, concurrency gate, Firecrawl credits)."]},{method:"GET",path:"/sites/:site_id/workspace/attachments/:attachment_id/image",tag:"workspace",summary:"Read the bytes of a chat image attachment (owner thumbnails and replay).",status:"implemented"},{method:"DELETE",path:"/sites/:site_id/workspace/attachments/:attachment_id",tag:"workspace",summary:"Delete an unsent chat image attachment.",status:"implemented",notes:["Attachments already sent with a message return 409 WORKSPACE_ATTACHMENT_BOUND."]},{method:"GET",path:"/internal/workspace-attachments/:site_id/:attachment_id",tag:"workspace",summary:"Internal side-channel for the Workspace Agent to read a chat image attachment.",status:"implemented"},{method:"GET",path:"/sites/:site_id/threads",tag:"workspace",summary:"List a site's named Agent threads (workspace conversations).",status:"implemented",response_schema:"SiteThreadListResponseSchema",notes:["The browser can only list threads that belong to the current site."]},{method:"POST",path:"/sites/:site_id/threads",tag:"workspace",summary:"Create a new named Agent thread for a site.",status:"implemented",request_body_schema:"CreateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The created thread is scoped to the current site; the browser cannot create a thread for another site."]},{method:"PATCH",path:"/sites/:site_id/threads/:thread_id",tag:"workspace",summary:"Rename or archive an Agent thread.",status:"implemented",request_body_schema:"UpdateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The server verifies the thread belongs to the current site and tenant before applying the update."]},{method:"GET",path:"/sites/:site_id/workspace/runs/active",tag:"workspace",summary:"Look up the site's current in-flight Workspace Agent run across all threads.",status:"implemented",response_schema:"ActiveWorkspaceRunResponseSchema",notes:["Scoped to the current site regardless of thread; the browser cannot query another site's active run."]},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations",tag:"agent/workspace",summary:"Create or replay a deterministic FORM_SPEC save operation.",status:"implemented",request_body_schema:"FormDesignSaveRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id",tag:"agent/workspace",summary:"Read a persisted FORM_SPEC save operation.",status:"implemented",response_schema:"FormDesignOperationResponseSchema"},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id/resume",tag:"agent/workspace",summary:"Resume a recoverable FORM_SPEC save with its original fingerprint.",status:"implemented",request_body_schema:"FormDesignResumeRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/sites/:site_id/workspace/runs/latest",tag:"workspace",summary:"Look up the latest workspace Agent run for a site so Step 4 re-entry can replay persisted events without re-triggering the model.",status:"implemented",response_schema:"LatestWorkspaceRunResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sessions",tag:"sandbox-sessions",summary:"Persist or update an Agent-owned on-demand preview session; optional current/ready-session guards support current-snapshot CAS and guarded in-place snapshot advance.",status:"implemented",request_body_schema:"PersistPreviewSessionRequestSchema",response_schema:"PersistPreviewSessionResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sandbox-cleanups/claim",tag:"sandbox-sessions",summary:"Claim up to 32 persisted retired preview sessions under exact current snapshot and canonical ready-session CAS; preserve the current physical sandbox and retry stopping tombstones across processes.",status:"implemented",request_body_schema:"ClaimPreviewSandboxCleanupsRequestSchema",response_schema:"ClaimPreviewSandboxCleanupsResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sandbox-cleanups/:session_id/complete",tag:"sandbox-sessions",summary:"Acknowledge confirmed provider termination for an exact tenant/site/session/sandbox stopping tombstone; matching stopped acknowledgements are idempotent.",status:"implemented",request_body_schema:"CompletePreviewSandboxCleanupRequestSchema",response_schema:"CompletePreviewSandboxCleanupResponseSchema"},{method:"GET",path:"/sites/:site_id/preview-sessions/current",tag:"sandbox-sessions",summary:"Read the latest tenant-scoped preview session for a site.",status:"implemented",response_schema:"SandboxSessionSchema"},{method:"POST",path:"/sites/:site_id/preview/activate",tag:"site-preview",summary:"Activate the existing preview sandbox for a site.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/v1/agent/site-preview/:site_id/activate",tag:"agent/site-preview",summary:"Activate the existing preview sandbox for a site through Agent.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/sites/:site_id/deployments",tag:"deployments",summary:"Queue an explicit user-confirmed publish from the latest current snapshot.",status:"implemented",request_body_schema:"CreateDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema",notes:["The server resolves the latest current snapshot and validates site and snapshot existence, in-flight deployment state, and site operation lock before creating the deployment record and queue job.","The API returns after creating the deployment record and queue job; worker-service claims deployment_jobs for build and Cloudflare publish."]},{method:"POST",path:"/sites/:site_id/deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment from a snapshot.",status:"implemented",request_body_schema:"CreateQualityCheckDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/quality-check/status",tag:"deployments",summary:"Read the latest quality-check deployment status.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"POST",path:"/internal/site-deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/quality-check/status",tag:"deployments",summary:"Read the latest internal quality-check deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"POST",path:"/internal/site-deployments/publish",tag:"deployments",summary:"Queue a publish deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the latest current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/publish/status",tag:"deployments",summary:"Read the latest internal publish deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"GET",path:"/sites/:site_id/deployments/current",tag:"deployments",summary:"Read the latest deployment for workspace refresh recovery.",status:"implemented",response_schema:"CurrentDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/status",tag:"deployments",summary:"Read current in-flight deployment and latest released deployment.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/:deployment_id",tag:"deployments",summary:"Read one tenant-scoped deployment for status polling.",status:"implemented",response_schema:"GetDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"List CMS collections for a site.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"Create a CMS collection bound to generated content.",status:"planned"},{method:"GET",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"List CMS entries for a collection.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"Create a CMS entry.",status:"planned"},{method:"PATCH",path:"/sites/:site_id/cms/collections/:collection_id/entries/:entry_id",tag:"cms",summary:"Update a CMS entry.",status:"planned"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/version-record",tag:"versions",summary:"Record the sandbox accepted git commit for a promoted snapshot version.",status:"implemented",request_body_schema:"RecordSnapshotVersionRequestSchema",response_schema:"RecordSnapshotVersionResponseSchema"},{method:"GET",path:"/sites/:site_id/versions",tag:"versions",summary:"List snapshot-backed site versions.",status:"implemented",response_schema:"ListSiteVersionsResponseSchema"},{method:"POST",path:"/sites/:site_id/versions/:snapshot_id/restore",tag:"versions",summary:"Restore a site to an earlier snapshot version.",status:"implemented",response_schema:"RestoreSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/domains/configuration",tag:"custom-domains",summary:"Read the authoritative site domain configuration.",status:"implemented",response_schema:"GetSiteDomainConfigurationResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/active-domain",tag:"internal/active-domain",summary:"Read whether an internal site has an active primary domain.",status:"implemented",response_schema:"GetActiveSiteDomainResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/check",tag:"publish-workflow",summary:"Check a publish workflow domain and start its operation.",status:"implemented",request_body_schema:"CheckSitePublishDomainRequestSchema",response_schema:"CheckSitePublishDomainResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation",tag:"publish-workflow",summary:"Read the current publish workflow domain operation.",status:"implemented",response_schema:"GetSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation/reconcile",tag:"publish-workflow",summary:"Recover or reconcile the current publish workflow domain operation.",status:"implemented",response_schema:"ReconcileSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/remediation/confirm",tag:"publish-workflow",summary:"Confirm the current DNS remediation plan.",status:"implemented",request_body_schema:"ConfirmSitePublishDomainRemediationRequestSchema",response_schema:"ConfirmSitePublishDomainRemediationResponseSchema"},{method:"POST",path:"/sites/:site_id/integrations/gsc/auth/start",tag:"gsc",summary:"Start Google Search Console authorization for a site.",status:"implemented",request_body_schema:"StartGscAuthRequestSchema",response_schema:"StartGscAuthResponseSchema"},{method:"GET",path:"/sites/:site_id/integrations/gsc/status",tag:"gsc",summary:"Read Google Search Console authorization and property status.",status:"implemented",response_schema:"GscStatusResponseSchema"},{method:"GET",path:"/admin/tenants",tag:"admin",summary:"Admin tenant listing.",status:"planned"},{method:"GET",path:"/usage/summary",tag:"usage",summary:"Summarize tenant usage and cost controls.",status:"planned"},{method:"GET",path:"/sites/:site_id/publish-workflow/active",tag:"publish-workflow",summary:"Read the active site publish workflow.",status:"implemented",response_schema:"SitePublishWorkflowActiveResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/start",tag:"publish-workflow",summary:"Start or recover the site publish workflow.",status:"implemented",request_body_schema:"StartSitePublishWorkflowRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/repair-task",tag:"publish-workflow",summary:"Retired repair task entry: returns 409 WORKSPACE_REPAIR_REQUIRED; use the Workspace repair action.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"ApiErrorEnvelopeSchema"},{method:"GET",path:"/sites/:site_id/publish-workflow/:workflow_id",tag:"publish-workflow",summary:"Read and reconcile a site publish workflow quality task.",status:"implemented",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"PATCH",path:"/sites/:site_id/publish-workflow/:workflow_id/step",tag:"publish-workflow",summary:"Move the site publish workflow to an allowed step.",status:"implemented",request_body_schema:"UpdateSitePublishWorkflowStepRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/cancel",tag:"publish-workflow",summary:"Cancel a stable site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/publish",tag:"publish-workflow",summary:"Start formal publishing for a site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowPublishResponseSchema"}],w2=[{method:"POST",path:"/v1/agent/clarify/:site_id",tag:"clarify",summary:"Stream Step 2 clarify questions as SSE; event_order includes optional skill.selecting, skill.selected, clarify.archetype_proposals, and run.failed on errors.",status:"implemented",request_body_schema:"ClarifyRunInputSchema without tenant_id/site_id",event_schema:"ClarifyStreamEventSchema",event_order:["run.started","skill.selecting","skill.selected","clarify.partial","clarify.archetype_proposals","clarify.finished","run.failed"]},{method:"POST",path:"/v1/agent/sitemap/:site_id",tag:"sitemap",summary:"Stream Step 3 sitemap generation as SSE; event_order includes sitemap.partial and run.failed on errors.",status:"implemented",request_body_schema:"Step5SitemapStartRequestSchema (browser marker only; API injects committed Step5 strategy)",event_schema:"SitemapStreamEventSchema",event_order:["run.started","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","run.failed"]}],_k=t.object({id:t.string().min(1),role:t.enum(["system","user","assistant"]),metadata:t.unknown().optional(),parts:t.array(ki).min(1)}),xd=_k.extend({role:t.literal("user")}).superRefine((e,n)=>{let s=0;for(let[i,a]of e.parts.entries()){if(a.type!=="file")continue;s+=1;let o=a;xa.safeParse(o.mediaType).success||n.addIssue({code:"custom",path:["parts",i,"mediaType"],message:"Attachment mediaType must be image/png, image/jpeg or image/webp"}),(typeof o.url!="string"||Ea(o.url)===null)&&n.addIssue({code:"custom",path:["parts",i,"url"],message:"Attachment url must be a workspace attachment image path"})}s>ya&&n.addIssue({code:"custom",path:["parts"],message:`A message may carry at most ${ya} attachments`})}),P2=t.object({base_snapshot_id:I.optional(),intent:t.literal("navigation_adaptation").optional(),message:xd.optional(),thread_id:at.optional(),client_run_key:t.string().min(1).max(200).optional()}).superRefine((e,n)=>{us(e.message)&&n.addIssue({code:"custom",path:["message"],message:"Workspace startup message must not contain secrets",params:{errorCode:"WORKSPACE_MESSAGE_CONTAINS_SECRET"}})}),gk=t.object({path:t.string().regex(/^\/v1\/workspace\/sites\/[^/]+\/socket$/),run_id:V,base_snapshot_id:I,run_kind:Pi}),C2=t.object({agent_run:it,websocket:gk,next_step:t.literal("workspace_socket")}),v2=t.object({agent_run:it}),D2=t.object({thread_id:at.optional()}),O2=t.object({agent_run:it.nullable(),thread:Ai.nullable()}),N2=t.object({status:Yp.default("active")}),j2=t.object({threads:t.array(Ai)}),L2=t.object({title:t.string().trim().min(1).max(200)}).strict(),M2=t.object({title:t.string().trim().min(1).max(200).optional(),status:t.literal("archived").optional()}).strict().refine(e=>e.title!==void 0||e.status!==void 0,{message:"title or status is required"}),U2=t.object({thread:Ai}),F2=t.object({agent_type:t.enum(["clarify","sitemap","workspace"]),thread_id:at.optional()}),G2=t.object({agent_run:it}),q2=t.enum(["client.message.create","client.resource.operation.create","client.run.cancel","client.tool.approve","server.run.started","server.user.message","server.assistant.delta","server.tool.started","server.tool.completed","server.workspace.suggestions","workspace.plan.created","workspace.worker.updated","workspace.task.updated","server.patch.applied","server.sitemap.updated","server.snapshot.created","server.snapshot.finalized","server.preview.invalidated","preview.build.started","preview.build.succeeded","preview.build.failed","server.run.finished","server.run.failed","server.error","server.activity.started","server.activity.updated","server.activity.finished","server.activity.failed"]),de=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,run_id:V.optional(),correlation_id:t.string().min(1).optional(),seq:t.number().int().positive().optional(),sent_at:t.string().min(1)}),hk=t.object({key:t.string().min(1),label:t.string().min(1),source_file:t.string().min(1).optional(),component_name:t.string().min(1).optional(),opening_element_range:t.object({start_line:t.number().int().positive(),start_column:t.number().int().nonnegative(),end_line:t.number().int().positive(),end_column:t.number().int().nonnegative()}).optional(),structural_path:t.string().min(1).optional(),text_preview:t.string().min(1).optional()}),Sk=t.discriminatedUnion("type",[de.extend({type:t.literal("client.message.create"),payload:t.object({client_message_id:t.string().min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),current_route_id:zn.optional(),interaction_response:Gs.optional(),selected_component:hk.optional(),intent:t.literal("navigation_adaptation").optional(),display_text:t.string().min(1).max(4e3).optional(),message:xd,base_snapshot_id:I.optional()}).superRefine((e,n)=>{e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"})})}),de.extend({type:t.literal("client.run.cancel"),payload:t.object({run_id:V,reason:t.string().min(1).optional()})}),de.extend({type:t.literal("client.tool.approve"),payload:t.object({tool_call_id:t.string().min(1),decision:t.enum(["approve","reject"]),reason:t.string().min(1).optional()})}),Fc]),fk=t.discriminatedUnion("type",[de.extend({type:t.literal("server.run.started"),payload:t.object({run_id:V,agent_type:t.literal("workspace")})}),de.extend({type:t.literal("server.user.message"),payload:t.object({client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(ki).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Gs.optional()})}),de.extend({type:t.literal("server.assistant.delta"),payload:t.object({message_id:t.string().min(1),parts:t.array(ki).min(1),status:t.enum(["streaming","ready"])})}),de.extend({type:t.literal("server.tool.started"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1)})}),de.extend({type:t.literal("server.tool.completed"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:ba.optional(),interaction_failure:fa.optional()})}),de.extend({type:t.literal("server.workspace.suggestions"),payload:gd.extend({run_id:V}).strict()}),de.extend({type:t.literal("workspace.plan.created"),payload:t.object({plan_id:t.string().min(1),run_kind:Pi,groups:t.array(Jo),tasks:t.array(er),dependencies:t.array(tr),expected_outputs:t.array(Oe),diagnostics:Zo,summary:Sd})}),de.extend({type:t.literal("workspace.worker.updated"),payload:t.object({group_id:t.string().min(1),phase:Xo,status:Qt,task_counts:fd,target_paths:t.array(Oe),diagnostics:t.array(t.string().min(1))})}),de.extend({type:t.literal("workspace.task.updated"),payload:t.object({task_id:t.string().min(1),group_id:t.string().min(1),status:Qt,target_path:Oe,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(Qo).optional()})}),de.extend({type:t.literal("server.patch.applied"),payload:t.object({patch_batch_id:t.string().min(1),changed_files:t.array(t.string().min(1)),sitemap_resync_queued:t.boolean()})}),de.extend({type:t.literal("server.sitemap.updated"),payload:t.object({sitemap_id:we,version:t.number().int().positive(),reason:t.string().min(1)})}),de.extend({type:t.literal("server.snapshot.created"),payload:t.object({snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/)})}),de.extend({type:t.literal("server.snapshot.finalized"),payload:t.object({snapshot_id:I})}),de.extend({type:t.literal("server.preview.invalidated"),payload:t.object({reason:t.string().min(1),next_preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()})}),de.extend({type:t.literal("preview.build.started"),payload:t.object({snapshot_id:I})}),de.extend({type:t.literal("preview.build.succeeded"),payload:t.object({snapshot_id:I})}),de.extend({type:t.literal("preview.build.failed"),payload:t.object({snapshot_id:I,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean()})}),de.extend({type:t.literal("server.run.finished"),payload:t.object({run_id:V,snapshot_id:I,degraded_reason:Pn.optional(),build_verified:t.boolean().optional(),resource_operation:bd.optional()})}),de.extend({type:t.literal("server.run.failed"),payload:t.object({run_id:V,error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional()})}),de.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})}),de.extend({type:t.literal("server.activity.started"),payload:t.object({activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:Jp,title:t.string().min(1).max(200),title_code:Mt.optional(),detail:t.string().max(360).optional(),detail_code:Mt.optional(),locks_input:t.boolean()})}),de.extend({type:t.literal("server.activity.updated"),payload:t.object({activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),title_code:Mt.optional(),detail:t.string().max(360).optional(),detail_code:Mt.optional()})}),de.extend({type:t.literal("server.activity.finished"),payload:t.object({activity_id:t.string().min(1)})}),de.extend({type:t.literal("server.activity.failed"),payload:t.object({activity_id:t.string().min(1),detail:t.string().max(360).optional()})})]),bk=fk.superRefine((e,n)=>{if(e.type==="server.user.message"&&e.payload.interaction_response&&!e.payload.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["payload","in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="server.tool.completed")return;let s=e.payload.name==="prepare_product_search_entry",i=!!e.payload.interaction_request,a=!!e.payload.interaction_failure;(s?i!==a:!i&&!a)||n.addIssue({code:"custom",path:["payload","interaction_request"],message:s?"prepare_product_search_entry requires exactly one of interaction_request or interaction_failure":"product search interaction results are only valid for prepare_product_search_entry"})}),W2=t.union([Sk,bk]),B2={path:"/v1/workspace/sites/:site_id/socket",protocol:"ws",status:"implemented",inbound_message_schema:"WorkspaceClientMessageSchema",outbound_message_schema:"WorkspaceServerMessageSchema",query_parameters:[{name:"run_id",required:!1,schema:"string",summary:"Workspace run id returned by the API run-start response."},{name:"run_kind",required:!1,schema:"WorkspaceRunKindSchema",summary:"Workspace run mode; initial_generation can auto-start when base_snapshot_id is present."},{name:"base_snapshot_id",required:!1,schema:"string",summary:"Authoritative base snapshot id for this workspace run."},{name:"unattended",required:!1,schema:'"1"',summary:"Unattended mode for machine-driven runs: interactive tools are withheld so the run cannot stall waiting for a human answer. Server-to-server only; the browser proxy strips it."}],ai_sdk_ui_compatible:!0,notes:["Assistant UI output is carried as AI SDK UIMessage parts, including text, data-*, and tool-* parts.","Operational AgentEvents remain persisted separately for replay and audit."]},Ed=t.string().regex(/^sha256:[a-f0-9]{64}$/),yk=t.enum(["create","update","delete","str_replace"]),Rd=t.enum(["sitemap_resync","smoke_test","prepare_preview"]),xk=t.object({old_string:t.string().min(1).describe("Exact text to find in the current file. Must match the file uniquely; include enough surrounding context (usually 2-4 adjacent lines)."),new_string:t.string().describe("Replacement text. May be empty to delete the matched text."),replace_all:t.boolean().optional()}).strict(),Ek=t.object({path:Oe,operation:yk,expected_hash:Ed.optional(),full_content:t.string().describe("Complete file content for create/update patches. Only this single field is a string value: every double quote inside the source code must be escaped so the field stays valid JSON. Avoid ASCII double quotes inside JSX attribute values and use corner quotes like \u300C\u751F\u65E5\u5FEB\u4E50\u300D for visitor-facing quoted examples. The surrounding patch object and the patches array are ordinary JSON structures, not strings.").optional(),edits:t.array(xk).min(1).max(20).optional()}).strict().superRefine((e,n)=>{let s=e.full_content!==void 0;if(e.operation==="delete"){s&&n.addIssue({code:"custom",path:["full_content"],message:"delete patches must not include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"});return}if(Nk(e.path)||n.addIssue({code:"custom",path:["path"],message:"Static App Router page paths must use lowercase ASCII kebab-case public segments."}),e.operation==="str_replace"){e.full_content!==void 0&&n.addIssue({code:"custom",path:["full_content"],message:"str_replace patches must not include full_content"}),(!e.edits||e.edits.length===0)&&n.addIssue({code:"custom",path:["edits"],message:"str_replace patches must include a non-empty edits array"});return}s||n.addIssue({code:"custom",path:["full_content"],message:"create/update patches must include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"})}),Rk=t.object({kind:t.enum(["block","page","site","chrome"]),id:t.string().min(1).max(120)}),Ik=t.object({base_key:t.string().min(1).max(120).regex(/^[A-Za-z0-9._:-]+$/).refine(e=>!e.includes(".."),{message:"base_key must not contain '..'"}),owner:Rk,count:t.number().int().min(1).max(12),query:t.string().min(1).max(400),role:t.enum(["hero","section","card","gallery","testimonial","decorative","site_background","nav_background","footer_background"]),orientation:t.enum(["landscape","portrait","square"]).optional(),altHint:t.string().min(1).max(300)}),Id=t.object({site_id:k,base_snapshot_id:I,reason:t.string().min(1),patches:t.array(Ek).min(1).describe("A real JSON array of patch objects. Never JSON.stringify this array, and never put an encoded JSON array inside a string \u2014 emit the array itself. Only full_content within a patch object is a string field."),media_requests:t.array(Ik).max(24).optional(),post_actions:t.array(Rd).optional()});function Td(e,n){let s=new Set;for(let[i,a]of e.patches.entries())s.has(a.path)&&n.addIssue({code:"custom",path:["patches",i,"path"],message:`Duplicate patch path: ${a.path}`}),s.add(a.path)}var K2=Id.superRefine(Td),z2=Id.omit({base_snapshot_id:!0}).extend({site_id:k.optional()}).superRefine(Td),Tk=Ie,kk=t.object({path:Tk,operation:t.enum(["upsert","delete"]).optional()}),kd=t.enum(["sync_cms_pages","sync_cms_navigation"]),H2=t.object({files:t.array(kk).min(1),post_actions:t.array(kd).optional()}).strict().overwrite(e=>e.post_actions?{...e,post_actions:[...new Set(e.post_actions)]}:e),Ak=t.enum(["BASE_SNAPSHOT_NOT_FOUND","PATCH_TARGET_NOT_FOUND","PATCH_TARGET_ALREADY_EXISTS","PATCH_EXPECTED_HASH_MISMATCH","PATCH_DIFF_UNSUPPORTED","PATCH_PROTECTED_FILE","PATCH_VALIDATION_FAILED","PATCH_MEDIA_REFERENCE_NOT_DECLARED","PATCH_BATCH_INVALID","PATCH_BATCH_FAILED","PATCH_BATCH_TOO_LARGE","STR_REPLACE_NOT_FOUND","STR_REPLACE_NOT_UNIQUE","STR_REPLACE_BINARY_FILE","STR_REPLACE_REQUIRES_READ","GLOBALS_CSS_EDIT_REJECTED"]),wk=t.object({status:t.literal("applied"),patch_batch_id:t.string().min(1),site_id:k,base_snapshot_id:I,snapshot_id:I,manifest_hash:Ed,object_key:t.string().min(1),changed_files:t.array(Oe).min(1),post_actions_queued:t.array(Rd),dropped_protected_files:t.array(t.string().min(1)).min(1).optional()}),Pk=t.object({status:t.literal("failed"),code:Ak,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),$2=t.discriminatedUnion("status",[wk,Pk]),V2=t.object({ok:t.literal(!0),post_actions:t.array(t.object({action:kd,status:t.enum(["succeeded","failed"])}).strict()).default([])}),Ad=Ie,Ck=t.enum(["text","binary"]),wd=t.object({path:Ad,kind:Ck,language:t.string().min(1).nullable(),size_bytes:t.number().int().nonnegative()}),Y2=t.object({path:Ad}),vk=wd.extend({kind:t.literal("text"),language:t.string().min(1),content:t.string()}),Dk=wd.extend({kind:t.literal("binary"),language:t.null(),mime_type:t.string().min(1),content_base64:t.string().min(1)}),X2=t.union([vk,Dk]);function us(e){return typeof e=="string"?/authorization\s*:|bearer\s+|token\s*=|secret\s*=|api[_-]?key\s*=|access[_\s-]?key\s*=|\bsk-[a-z0-9_-]{20,}|eyJ[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}/i.test(e):!e||typeof e!="object"?!1:Array.isArray(e)?e.some(n=>us(n)):Object.entries(e).some(([n,s])=>Ok(n)||us(s))}function Ok(e){let n=e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase();return/(^|[_-])(authorization|token|secret|api[_-]?key|apikey|access[_-]?key|accesskey)([_-]|$)/.test(n)}function Pd(e){let n=e.split("/");return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&n.every(s=>s!==""&&s!=="."&&s!=="..")}function Nk(e){if(/^(?:src\/)?app\/\.vcp\//.test(e))return hs(e);let n=/^app\/(?:(.*)\/)?page\.(?:tsx|jsx)$/.exec(e);if(!n)return!0;let i=(n[1]??"").split("/").filter(o=>o.length>0);return i.some(o=>o.startsWith("_"))?!0:i.filter(o=>!o.startsWith("@")&&!/^\(.+\)$/.test(o)).map(o=>o.replace(/^\((?:\.|\.\.|\.\.\.)\)/,"")).filter(o=>o.length>0).every(o=>/^\[.*\]$/.test(o)||Gn.test(`/${o}`))}var Cd=t.enum(["idle","creating","restoring_snapshot","installing_dependencies","starting_preview","ready","active","stopping","stopped","failed"]),wn=t.object({id:Jt,tenant_id:t.string().min(1),site_id:k,sandbox_id:t.string().min(1).nullable(),status:Cd,source_snapshot_id:I.nullable(),last_snapshot_id:I.nullable(),preview_url:t.string().url().nullable(),browser_preview_url:t.string().url().nullable().optional(),launch_id:t.string().min(1).nullable().optional(),last_activity_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),Q2=t.object({session_id:Jt.optional(),sandbox_id:t.string().min(1).optional(),source_snapshot_id:I.optional(),last_snapshot_id:I,expected_current_snapshot_id:I.optional(),expected_ready_session_id:Jt.optional(),expected_ready_session_last_snapshot_id:I.optional(),status:Cd,preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()}),Z2=t.object({preview_session:wn,next_step:t.literal("preview")}),J2=t.object({failed_count:t.number().int().nonnegative()}),eW=t.object({site_id:k}),tW=t.object({status:t.enum(["cancelled","stop_requested","no_active_run"]),agent_run:it.nullable()});export{tl as AESTHETIC_NOTE_MAX_LENGTH,Co as AI_IMAGE_GENERATION_MAX_QUANTITY,Dy as APPLICATION_LIBRARY_ERROR_CODES,lq as AbandonSiteSnapshotResponseSchema,aR as ActiveSiteDomainDataSchema,O2 as ActiveWorkspaceRunResponseSchema,Jp as ActivityKindSchema,Mt as ActivityTitleCodeSchema,eP as AdvanceSiteWorkflowRequestSchema,zp as AgentErrorCategorySchema,ir as AgentEventIdSchema,Uo as AgentEventRecordSchema,yd as AgentEventSchema,hd as AgentEventTypeSchema,ZT as AgentMessageHistoryPurposeSchema,Vp as AgentModelRouteSchema,JT as AgentPlanStepSchema,sq as AgentRunContextResponseSchema,V as AgentRunIdSchema,$p as AgentRunKindSchema,it as AgentRunRecordSchema,zI as AgentRunStatusSchema,Hp as AgentRunTypeSchema,at as AgentThreadIdSchema,HI as AgentThreadKindSchema,$I as AgentThreadOriginSchema,Ai as AgentThreadRecordSchema,Yp as AgentThreadStatusSchema,ok as AiSdkUiDataPartSchema,ck as AiSdkUiErrorPartSchema,sk as AiSdkUiFilePartSchema,ki as AiSdkUiMessagePartSchema,_k as AiSdkUiMessageSchema,nk as AiSdkUiReasoningPartSchema,ak as AiSdkUiSourceDocumentPartSchema,ik as AiSdkUiSourceUrlPartSchema,mk as AiSdkUiStepStartPartSchema,tk as AiSdkUiTextPartSchema,rk as AiSdkUiToolPartSchema,T2 as ApiContractStatusSchema,tT as ApiErrorEnvelopeSchema,U as ApiResponseSchema,y2 as AppendAgentEventRequestSchema,x2 as AppendAgentEventResponseSchema,Xj as ApplicationCreateResponseSchema,My as ApplicationLibraryApplicationSchema,Qj as ApplicationLibraryApplicationsDataSchema,cl as ApplicationLibraryErrorCodeSchema,Jj as ApplicationLibraryErrorResponseSchema,Zj as ApplicationLibraryTemplatesDataSchema,ll as ApplicationTemplateCatalogDataSchema,Oy as ApplicationTemplateCatalogItemSchema,vy as ApplicationTemplateConsumeDataSchema,Yj as ApplicationTemplateCreateRequestSchema,jy as ApplicationTemplateCreateResponseSchema,Ny as ApplicationTemplateCreatedApplicationSchema,oi as ApplicationTemplateDigestSchema,ky as ApplicationTemplateFieldSchema,Cy as ApplicationTemplateReferenceSchema,Ly as ApplicationTemplateSourceSchema,ri as ApplicationTemplateStableKeySchema,so as ApplicationTemplateV1Schema,Ak as ApplyPatchBatchErrorCodeSchema,Pk as ApplyPatchBatchFailureSchema,K2 as ApplyPatchBatchInputSchema,Ek as ApplyPatchBatchPatchSchema,Rd as ApplyPatchBatchPostActionSchema,$2 as ApplyPatchBatchResultSchema,wk as ApplyPatchBatchSuccessSchema,z2 as ApplyPatchBatchToolInputSchema,xk as ApplyPatchEditSchema,yk as ApplyPatchOperationSchema,Kp as ArchetypeProposalSchema,Yk as AuditLogIdSchema,Mk as AuthIdentityIdSchema,qk as AuthLoginCodeIdSchema,Gk as AuthOidcStateIdSchema,zF as AuthProfileSchema,Uk as AuthSessionIdSchema,Fk as AuthTokenIdSchema,Wk as AuthWsTicketIdSchema,Fx as BINDING_STATUSES,ed as BlockGenerationContextSchema,fs as BlockInteractionSchema,Wq as BlockMediaIntentSchema,Ho as BlockSchema,uf as BlockingSubsiteSchema,td as BrandingSchema,Zt as BriefIdSchema,Bo as BriefRecordSchema,yr as BusinessFactsSchema,hO as CHAT_COPY,gO as CLARIFICATION_COPY,px as CMS_FORM_FIELD_TYPES,Km as CMS_MAIN_PRODUCTS_MAX_LENGTH,g_ as CMS_PAGE_DIRECTORY_MAX_DEPTH,__ as CMS_PAGE_DIRECTORY_MAX_NODES,u_ as CMS_PAGE_URL_MAX_LENGTH,Yr as CMS_PAGE_URL_PATH_MAX_LENGTH,Nv as COMPONENT_I18N_FILE_SUFFIX,$s as COMPONENT_I18N_NAMESPACE,Qd as CONVERSION_CTA_LABEL_MAX_LENGTH,iE as CRAWLER_INTERNAL_ERROR_CODES,Fm as CURRENT_EDIT_ENGINE_VERSION,eW as CancelActiveWorkspaceRunRequestSchema,tW as CancelActiveWorkspaceRunResponseSchema,d1 as CheckDesignerPageProjectionRequestSchema,u1 as CheckDesignerPageProjectionResponseSchema,w_ as CheckDesignerPageProjectionResultSchema,ap as CheckSitePublishDomainDataSchema,QE as CheckSitePublishDomainRequestSchema,ZE as CheckSitePublishDomainResponseSchema,nd as ChromeDesignSchema,_T as ChromeFooterDesignSchema,uT as ChromeFooterShellSchema,pT as ChromeHeaderDesignSchema,lT as ChromeHeaderShellSchema,gT as ChromeMobileNavDesignSchema,Od as ClaimPreviewSandboxCleanupsRequestSchema,Nd as ClaimPreviewSandboxCleanupsResponseSchema,Iv as ClaimStaleWorkspaceRunsResponseSchema,BI as ClarifyQuestionOptionSchema,KI as ClarifyQuestionSchema,GI as ClarifyQuestionTypeSchema,qo as ClarifyQuestionsSchema,wG as ClarifyRunInputSchema,nr as ClarifySessionIdSchema,HT as ClarifySessionRecordSchema,PG as ClarifyStreamEventSchema,oL as CmsApplicationCoreInputSchema,rL as CmsApplicationCoreResultSchema,cL as CmsApplicationSeedInputSchema,mL as CmsApplicationSeedResultSchema,Xk as CmsCollectionBindingIdSchema,mM as CmsCollectionBindingSchema,Rl as CmsFormSchemaProjectionSchema,Ji as CmsManagedPageTypeSchema,FF as CmsNavigationActionSchema,UF as CmsNavigationCapabilitiesResponseSchema,II as CmsNavigationCapabilitiesSchema,Op as CmsNavigationCreateGroupBodySchema,jp as CmsNavigationCreateItemBodySchema,LF as CmsNavigationDefaultGroupBodySchema,vo as CmsNavigationDraftItemSchema,yI as CmsNavigationEditorContextSchema,jF as CmsNavigationEditorResponseSchema,bI as CmsNavigationGroupSchema,Dp as CmsNavigationItemSchema,RI as CmsNavigationMoveItemBodySchema,xI as CmsNavigationPatchGroupBodySchema,EI as CmsNavigationPatchItemBodySchema,MF as CmsNavigationSaveItemsBodySchema,Do as CmsNavigationTargetTypeSchema,f_ as CmsPageDirectoryGroupSchema,Qr as CmsPageDirectoryNodeSchema,$r as CmsPageDirectorySchema,ea as CmsPageTypeSchema,Kt as CmsPageUrlPathSchema,f1 as CmsSeoSyncStateSchema,Ts as CmsSiteIdSchema,tE as CompanyInfoSchema,kM as CompanyInfoTaskCreateRequestSchema,AM as CompanyInfoTaskCreateResponseSchema,wM as CompanyInfoTaskResponseSchema,ij as CompleteCustomerMaterialsRequestSchema,aj as CompleteDiagnosisRequestSchema,jd as CompletePreviewSandboxCleanupRequestSchema,Ld as CompletePreviewSandboxCleanupResponseSchema,nP as CompleteQualityOnlyWorkflowRequestSchema,dq as CompleteSiteSnapshotDeletionResponseSchema,tP as CompleteSiteWorkflowRequestSchema,oj as CompleteStrategyRequestSchema,sj as CompleteWebsiteScanRequestSchema,Lv as ComponentI18nResourcesSchema,C1 as ComposeDesignerPageResourceBodySchema,r0 as ComputeSnapshotEditChangesRequestSchema,c0 as ComputeSnapshotEditChangesResponseSchema,eR as ConfirmSitePublishDomainRemediationDataSchema,JE as ConfirmSitePublishDomainRemediationRequestSchema,tR as ConfirmSitePublishDomainRemediationResponseSchema,c2 as ConfirmSiteStructureRequestSchema,zj as ConnectDynamicCollectionInputSchema,SL as ConnectFormInputSchema,Gt as ConversionHintsSchema,aE as CrawlerInternalErrorCodeSchema,PM as CrawlerInternalErrorSchema,fn as CrawlerTaskCodeSchema,SM as CrawlerTaskCreateRequestSchema,yM as CrawlerTaskCreateResponseSchema,$x as CrawlerTaskFailureErrorCodeSchema,Ul as CrawlerTaskFailureStageSchema,Yx as CrawlerTaskPageSchema,fM as CrawlerTaskPagesQuerySchema,RM as CrawlerTaskPagesResponseSchema,EM as CrawlerTaskStatusResponseSchema,Yt as CrawlerTaskUuidSchema,Gq as CreateAgentRunConflictResponseSchema,iq as CreateAgentRunRequestSchema,aq as CreateAgentRunResponseSchema,vq as CreateDeploymentRequestSchema,QI as CreateDeploymentResponseSchema,z0 as CreateDocumentUploadRequestSchema,a0 as CreateExternalSiteEditRequestSchema,m0 as CreateExternalSiteEditResponseSchema,Q0 as CreateImageUploadRequestSchema,G0 as CreateInputSourceRequestSchema,Dq as CreateQualityCheckDeploymentRequestSchema,MG as CreateSiteBriefRequestSchema,JG as CreateSiteBriefResponseSchema,UG as CreateSiteDraftRequestSchema,LG as CreateSiteInputSchema,L2 as CreateSiteThreadRequestSchema,Zw as CreateSiteWorkflowRequestSchema,ru as CreateTextInputSourceRequestSchema,cu as CreateUrlInputSourceRequestSchema,Nq as CurrentDeploymentResponseSchema,QN as CustomerMaterialsDraftResponseSchema,$a as CustomerMaterialsDraftSchema,ZN as CustomerMaterialsNullableResponseSchema,Va as CustomerMaterialsRecordSchema,XN as CustomerMaterialsResponseSchema,cy as CustomerMaterialsStatusSchema,bS as DEFAULT_FONTS,Vm as DEFAULT_SITE_DESIGN_RADIUS_ID,Uu as DEFAULT_SITE_LOCALE,AO as DEFAULT_SUBSITE_PALETTE,Ks as DEFAULT_WEIGHT_STYLE_ID,gC as DEPLOYMENT_ACTIVE_STATUSES,Pt as DEPLOYMENT_LIFECYCLE_TRANSITIONS,Ph as DEPLOYMENT_PROGRESS_STEP_CODES,eT as DEPLOYMENT_REALTIME_CHANNEL,en as DEPLOYMENT_STATUSES,hC as DEPLOYMENT_TERMINAL_STATUSES,uS as DEPLOYMENT_TRANSITION_ERROR_CODE,Fq as DEPLOYMENT_WEBSOCKET_CONTRACT,ef as DESIGNER_BRIDGE_TELEMETRY_MAX_EVENTS,QA as DESIGNER_COMPONENT_LIBRARY_ERROR_CODES,T1 as DESIGNER_PAGE_LIBRARY_ERROR_CODES,q0 as DOCUMENT_EXTENSION_WHITELIST,W0 as DOCUMENT_MIME_WHITELIST,kE as DOMAIN_DNS_PURPOSES,PE as DOMAIN_DNS_REMEDIATION_STATUSES,AE as DOMAIN_DNS_VERIFICATION_STATUSES,EE as DOMAIN_OBSERVED_STATUSES,IE as DOMAIN_ROUTING_MODES,_1 as DeleteDesignerPageErrorDetailsSchema,c1 as DeleteDesignerPageRequestSchema,m1 as DeleteDesignerPageResponseSchema,k_ as DeleteDesignerPageResultSchema,pq as DeleteSiteSnapshotResponseSchema,dt as DeploymentIdSchema,Bk as DeploymentJobIdSchema,Ch as DeploymentProgressStepCodeSchema,Dh as DeploymentProgressStepSchema,vh as DeploymentProgressStepStatusSchema,Jc as DeploymentProgressStepsSchema,Lt as DeploymentRecordSchema,Uq as DeploymentRedisPubSubEventSchema,Ko as DeploymentStatusSchema,Gp as DeploymentStatusSummarySchema,wa as DeploymentTransitionError,Qp as DeploymentTypeSchema,Ii as DeploymentWsDeploymentPayloadSchema,Mq as DeploymentWsServerMessageSchema,JI as DeploymentWsServerMessageTypeSchema,XT as DesignPlanGenerationOutcomeSchema,QT as DesignPlanGenerationReasonSchema,Ci as DesignPlanIdSchema,zq as DesignPlanPatchSchema,$T as DesignPlanRecordSchema,id as DesignPlanSchema,qe as DesignTokenBlockError,qq as DesignTokensSchema,vv as DesignerBridgeTelemetryBatchSchema,nf as DesignerBridgeTelemetryEventSchema,tf as DesignerBridgeTelemetryEventTypeSchema,d_ as DesignerComponentCatalogItemSchema,Br as DesignerComponentCategoriesDataSchema,Wr as DesignerComponentCategoryNodeSchema,Bt as DesignerComponentExactVersionSchema,zr as DesignerComponentInstallDataSchema,Kr as DesignerComponentsDataSchema,O_ as DesignerPageCatalogItemSchema,ac as DesignerPageCategoriesDataSchema,ic as DesignerPageCategoryNodeSchema,R_ as DesignerPageDeleteBlockReasonSchema,E_ as DesignerPageDisabledReasonSchema,Fn as DesignerPageExactVersionSchema,tc as DesignerPageGroupSchema,rc as DesignerPageInstallDataSchema,ec as DesignerPageNodeSchema,mc as DesignerPageResourcePreparationDataSchema,D_ as DesignerPageResourceSourceSchema,G_ as DesignerPageResourceTemplateSchema,zt as DesignerPageResourceTypeSchema,oc as DesignerPagesDataSchema,Vi as DesignerResourceVersionSchema,lc as DesignerSitePagesDataSchema,A1 as DesignerSiteRouteIdSchema,ep as DomainConfigurationSchema,yo as DomainDnsPurposeSchema,jE as DomainDnsRecordSchema,NE as DomainDnsRemediationChangeSchema,Ql as DomainDnsRemediationRecordSchema,Zl as DomainDnsRemediationResultSchema,CE as DomainDnsRemediationStatusSchema,OE as DomainDnsVerificationObservationSchema,Xl as DomainDnsVerificationResultSchema,wE as DomainDnsVerificationStatusSchema,RE as DomainObservedStatusSchema,DE as DomainOperationErrorSchema,fi as DomainOperationSchema,vE as DomainOperationStatusSchema,xo as DomainOperationTypeSchema,Jl as DomainRecordSchema,TE as DomainRoutingModeSchema,fO as EDIT_ENGINE_VERSION_HEADER,bO as EDIT_ENGINE_VERSION_SOURCE_HEADER,o0 as EMPTY_EXTERNAL_SITE_EDIT_CHANGES,pO as ERROR_COPY,Fd as EXTERNAL_SITE_EDIT_INFRASTRUCTURE_REASONS,Ud as EXTERNAL_SITE_EDIT_PROMPT_MAX_LENGTH,za as EditEngineVersionParseError,pc as EnhanceDesignerPageResourceBodySchema,QG as EnhanceDesignerPageResourceResponseSchema,QF as EnsureSiteInitialReviewRequestSchema,d0 as ExternalSiteEditCallbackAckSchema,p0 as ExternalSiteEditCallbackPayloadSchema,Gd as ExternalSiteEditCallbackStatusSchema,Di as ExternalSiteEditChangeKindSchema,dr as ExternalSiteEditChangesSchema,Pn as ExternalSiteEditDegradedReasonSchema,Ft as ExternalSiteEditExternalIdSchema,cr as ExternalSiteEditOutcomeSchema,Yd as ExternalSiteEditPageChangeSchema,Wd as ExternalSiteEditPageTypeSchema,Vd as ExternalSiteEditSectionChangeSchema,Kd as ExternalSiteEditSiteWideChangeSchema,Bd as ExternalSiteEditSiteWideKindSchema,rr as ExternalSiteEditTaskIdSchema,gs as ExternalSiteEditTaskSchema,qd as ExternalSiteEditTaskStatusSchema,WG as ExternalSyncSiteRequestSchema,ZG as ExternalSyncSiteResponseSchema,iu as ExtractedFactKindSchema,bs as ExtractedFactSchema,no as FIELD_TYPES,hv as FILL_IN_NOT_AVAILABLE_ERROR_CODE,fv as FILL_IN_TARGET_MODIFIED_ERROR_CODE,Sv as FILL_IN_TARGET_NOT_OMITTED_ERROR_CODE,ob as FONT_LICENSE_BUILD_ERROR_CODES,dm as FONT_PAIRINGS,va as FONT_PAIRING_IDS,Rx as FORM_DESIGN_ERROR_CODES,Ex as FORM_DESIGN_FAILURE_STAGES,yx as FORM_DESIGN_OPERATION_STAGES,xx as FORM_DESIGN_OPERATION_STATUSES,mi as FORM_FIELD_TYPES,_l as FORM_SCENE_CODES,gl as FORM_SCENE_UNKNOWN,Wy as FORM_SHAPE_EMBEDDED,dx as FORM_SPEC_FIELD_TYPE_TO_CMS,Sl as FORM_SPEC_FILE_MIN_RUNTIME_VERSION,sx as FORM_SPEC_LOCALIZABLE_FIELD_PATHS,hl as FORM_SPEC_MULTISTEP_MIN_RUNTIME_VERSION,PL as FORM_TEMPLATE_CATEGORY_COUNTS,wL as FORM_TEMPLATE_CATEGORY_SLUGS,J2 as FailStaleInFlightWorkspaceRunsResponseSchema,ai as FieldDeclSchema,Tm as FillInTargetSchema,FM as FirecrawlBatchCreateRequestSchema,GM as FirecrawlBatchCreatedResponseSchema,cE as FirecrawlBatchErrorSchema,WM as FirecrawlBatchErrorsResponseSchema,rE as FirecrawlBatchPageSchema,qM as FirecrawlBatchStatusResponseSchema,NM as FirecrawlCrawlCreateRequestSchema,jM as FirecrawlCrawlCreatedResponseSchema,LM as FirecrawlCrawlStatusResponseSchema,Bl as FirecrawlJobStatusSchema,DM as FirecrawlMapRequestSchema,OM as FirecrawlMapResponseSchema,BM as FirecrawlQueueStatusResponseSchema,MM as FirecrawlScrapeRequestSchema,UM as FirecrawlScrapeResponseSchema,dT as FooterShellSurfaceSchema,$y as FormBlockIdSchema,pi as FormDefinitionIdSchema,Sx as FormDesignAffectedFilesSchema,So as FormDesignErrorCodeSchema,WL as FormDesignErrorSchema,kl as FormDesignFailureStageSchema,ue as FormDesignHashSchema,jL as FormDesignOpenResponseSchema,fx as FormDesignOperationFingerprintInputSchema,lo as FormDesignOperationIdSchema,Al as FormDesignOperationNextActionSchema,zk as FormDesignOperationRecordIdSchema,GL as FormDesignOperationRecordSchema,fo as FormDesignOperationResponseSchema,Pl as FormDesignOperationSchema,ho as FormDesignOperationStageSchema,Tl as FormDesignOperationStatusSchema,qL as FormDesignOperationTransitionRequestSchema,wl as FormDesignPreviewRefreshStatusSchema,ML as FormDesignQueryResponseSchema,UL as FormDesignResumeRequestSchema,FL as FormDesignResumeResponseSchema,bx as FormDesignSaveRequestSchema,LL as FormDesignSaveResponseSchema,Il as FormDesignSharedImpactSchema,go as FormDesignStandardizationSchema,zy as FormFieldDeclSchema,cs as FormFieldNameSchema,ro as FormMetadataSchema,po as FormOptionValueSchema,oo as FormSceneSchema,By as FormShapeSchema,Vy as FormSpecBindingSchema,Xy as FormSpecFieldNodeSchema,Zy as FormSpecNodeSchema,Yy as FormSpecOptionSchema,Qy as FormSpecStepBreakNodeSchema,_o as FormSpecV1Schema,CL as FormTemplateCatalogResponseSchema,El as FormTemplateCategorySlugSchema,mx as FormTemplateCategoryV1Schema,Nt as FormTemplateTextSchema,lx as FormTemplateV1Schema,_R as GA4_AUTHORIZATION_STATUSES,hR as GA4_AUTH_ATTEMPT_STATUSES,ER as GA4_BINDING_REASONS,fR as GA4_BINDING_STATUSES,yR as GA4_VERIFICATION_STATUSES,Yn as GLOBAL_DESIGN_TOKENS_END,dn as GLOBAL_DESIGN_TOKENS_START,oR as GSC_AUTH_STATUSES,rR as GSC_BINDING_STATUSES,cR as GSC_PROPERTY_TYPES,DR as Ga4AccountOptionSchema,lp as Ga4AuthAttemptSchema,SR as Ga4AuthAttemptStatusSchema,TR as Ga4AuthorizationSchema,gR as Ga4AuthorizationStatusSchema,RR as Ga4BindingReasonSchema,kR as Ga4BindingSchema,bR as Ga4BindingStatusSchema,NR as Ga4DataStreamOptionSchema,jR as Ga4DataStreamsDataSchema,_F as Ga4DataStreamsQuerySchema,uF as Ga4DataStreamsResponseSchema,CR as Ga4DeploymentSchema,wR as Ga4ModeSchema,LR as Ga4MutationSchema,vR as Ga4PropertyOptionSchema,OR as Ga4SetupResourcesDataSchema,dF as Ga4SetupResourcesQuerySchema,pF as Ga4SetupResourcesResponseSchema,pp as Ga4StatusDataSchema,lF as Ga4StatusQuerySchema,mF as Ga4StatusResponseSchema,PR as Ga4TrackingSchema,AR as Ga4VerificationSchema,xR as Ga4VerificationStatusSchema,aI as GenerateAiImagesRequestSchema,oI as GenerateAiImagesResponseSchema,Pp as GeneratedAiImageResultSchema,DU as GetActiveSiteDomainResponseSchema,jq as GetDeploymentResponseSchema,ZI as GetDeploymentsStatusResponseSchema,l0 as GetExternalSiteEditResponseSchema,vU as GetSiteDomainConfigurationResponseSchema,TN as GetSiteLauncherPermissionResponseSchema,Eo as GetSitePublishDomainOperationDataSchema,nR as GetSitePublishDomainOperationResponseSchema,mN as GetTemplateUpgradeReportQuerySchema,lN as GetTemplateUpgradeReportResponseSchema,JU as GoogleSearchConsoleAuthStartDataSchema,ZU as GoogleSearchConsoleAuthStartRequestSchema,eF as GoogleSearchConsoleAuthStartResponseSchema,VU as GoogleSearchConsoleAuthStatusSchema,YU as GoogleSearchConsoleBindingStatusSchema,XU as GoogleSearchConsolePropertyTypeSchema,QU as GoogleSearchConsoleStateSchema,nF as GoogleSearchConsoleStatusDataSchema,tF as GoogleSearchConsoleStatusInputSchema,sF as GoogleSearchConsoleStatusResponseSchema,zU as GscAuthStartDataSchema,KU as GscAuthStartRequestSchema,HU as GscAuthStartResponseSchema,Ro as GscAuthStatusSchema,Io as GscBindingStatusSchema,To as GscPropertyTypeSchema,lR as GscStateInputSchema,$U as GscStateSchema,cp as GscStatusDataSchema,pR as GscStatusResponseSchema,Vr as HOME_PAGE_URL_PATH,cT as HeaderShellBehaviorSchema,mT as HeaderShellShapeSchema,rT as HeaderShellSurfaceSchema,oT as HeaderShellVariantSchema,qx as HomeUrlCrawlerTaskCreateRequestSchema,da as HttpUrlSchema,$0 as IMAGE_EXTENSION_WHITELIST,V0 as IMAGE_MIME_WHITELIST,qr as INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY,sc as INSERT_NEW_PAGE_CATEGORY_GROUP_KEY,av as INTERNAL_RUN_LEASE_OWNER_HEADER,Fu as ISO_639_3_TO_SITE_LOCALE,mu as ImageRoleSchema,xd as InboundUserMessageSchema,jj as IndustryClassificationRequestSchema,Lj as IndustryClassificationResultSchema,xy as IndustryConfidenceSchema,ml as InitializationResultSchema,su as InputBundleStatusSchema,xs as InputConflictSchema,Z0 as InputContextBundleSchema,An as InputContextSourceIdSchema,ou as InputSourceSchema,Ni as InputSourceStatusSchema,Oi as InputSourceTypeSchema,QO as InspectTemplateUpgradeStateRequestSchema,ZO as InspectTemplateUpgradeStateResponseSchema,t1 as InstallDesignerComponentBodySchema,zG as InstallDesignerComponentResponseSchema,w1 as InstallDesignerPageBodySchema,VG as InstallDesignerPageResponseSchema,Oq as InternalCreateDeploymentResponseSchema,Aq as InternalEnsureSubsitePublishRequestSchema,wq as InternalEnsureSubsitePublishResponseSchema,Z as InternalEntityIdSchema,Lq as InternalGetDeploymentsStatusResponseSchema,Pq as InternalGetSubsitePublishStatusRequestSchema,Cq as InternalGetSubsitePublishStatusResponseSchema,Tq as InternalPrepareSubsitePreviewRequestSchema,kq as InternalPrepareSubsitePreviewResponseSchema,ay as KNOWLEDGE_CATEGORY_CODES,zm as KnowledgeCategoryCodeSchema,KN as KnowledgeContextReadinessSchema,ry as KnowledgeSourceReadinessSchema,oy as KnowledgeSourceReadinessStatusSchema,zl as LEGACY_FILE_MUTATION_TOOL_NAME,Ou as LEGACY_SITE_LOCALE_CODES,F2 as LatestAgentRunQuerySchema,G2 as LatestAgentRunResponseSchema,D2 as LatestWorkspaceRunQuerySchema,v2 as LatestWorkspaceRunResponseSchema,JM as LauncherPromptTemplateApplyRequestSchema,eU as LauncherPromptTemplateApplyResponseSchema,gE as LauncherPromptTemplateCatalogItemSchema,QM as LauncherPromptTemplateCatalogQuerySchema,ZM as LauncherPromptTemplateCatalogSchema,uE as LauncherPromptTemplateKindSchema,_E as LauncherPromptTemplateLocaleSchema,Si as LauncherPromptTemplateTypeSchema,Xb as LauncherScopeSchema,R2 as ListAgentEventsQuerySchema,E2 as ListAgentEventsResponseSchema,BG as ListDesignerComponentCategoriesResponseSchema,e1 as ListDesignerComponentsQuerySchema,KG as ListDesignerComponentsResponseSchema,HG as ListDesignerPageCategoriesResponseSchema,k1 as ListDesignerPagesQuerySchema,$G as ListDesignerPagesResponseSchema,XG as ListDesignerSitePagesResponseSchema,nI as ListMediaLibraryAssetsQuerySchema,sI as ListMediaLibraryAssetsResponseSchema,I2 as ListSiteAgentEventsQuerySchema,Eq as ListSiteVersionsResponseSchema,pN as ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema,dN as ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema,Ev as ListWorkspacePageCheckpointsResponseSchema,K0 as MAX_DOCUMENT_SOURCES_PER_SITE,B0 as MAX_DOCUMENT_UPLOAD_BYTES,X0 as MAX_IMAGE_SOURCES_PER_SITE,Y0 as MAX_IMAGE_UPLOAD_BYTES,YR as MAX_NAV_LABEL_WIDTH,yb as MAX_SUBSITE_MEDIA_REPLACEMENTS,yP as MAX_UNBOUND_WORKSPACE_ATTACHMENTS_PER_SITE,ya as MAX_WORKSPACE_ATTACHMENTS_PER_MESSAGE,AP as MAX_WORKSPACE_URL_CAPTURES_PER_SITE_HOUR,xp as MEDIA_LIBRARY_AUDIO_EXTENSIONS,kp as MEDIA_LIBRARY_AUDIO_MIME_TYPES,Ep as MEDIA_LIBRARY_DOCUMENT_EXTENSIONS,eI as MEDIA_LIBRARY_EXTENSIONS,Rp as MEDIA_LIBRARY_FILE_EXTENSIONS,bp as MEDIA_LIBRARY_IMAGE_EXTENSIONS,JR as MEDIA_LIBRARY_IMAGE_MAX_BYTES,Ip as MEDIA_LIBRARY_IMAGE_MIME_TYPES,fp as MEDIA_LIBRARY_MAX_BYTES,tI as MEDIA_LIBRARY_MIME_TYPES,yp as MEDIA_LIBRARY_VIDEO_EXTENSIONS,Tp as MEDIA_LIBRARY_VIDEO_MIME_TYPES,Fv as MIGRATION_PRODUCTS_CMS_DETAIL_PAGE_TITLE,Uv as MIGRATION_PRODUCTS_DETAIL_PREFIX,Wv as MIGRATION_PRODUCTS_DETAIL_VIEW_VARIANT,qv as MIGRATION_PRODUCTS_LIST_VIEW_VARIANT,of as MIGRATION_PRODUCTS_ROUTE,yt as MIGRATION_PRODUCTS_SLUG,Gv as MIGRATION_PRODUCTS_VIEW_BLOCK_TYPE,Ky as MODEL_DECLARABLE_FORM_FIELD_TYPES,Kl as MODEL_FILE_MUTATION_TOOL_NAMES,my as MOTION_PRESETS,Xa as MOTION_PRESET_IDS,Kq as MediaAssetSchema,iT as MediaAttributionSchema,Po as MediaLibraryAssetSchema,Ap as MediaLibraryFileTypeSchema,wp as MediaLibrarySourceSchema,Rk as MediaRequestOwnerSchema,Vk as MediaResolutionCacheIdSchema,kI as MigrationCollectionProgressSchema,jo as MigrationCollectionSchema,WF as MigrationContentProgressSchema,TI as MigrationReasonCodeSchema,wI as MigrationRedirectProgressSchema,AI as MigrationRedirectReasonCodeSchema,Lp as MigrationRedirectSiteReasonSchema,JA as MockDesignerComponentInsertDataSchema,ZA as MockDesignerComponentInsertRequestSchema,Go as MotionLevelSchema,vx as NAV_ITEMS_LOCALIZABLE_FIELD_PATHS,Dx as NAV_ITEMS_MACHINE_FIELD_PATHS,ES as NEXT_FONT_DISPLAY_NAMES,bt as NEXT_FONT_REGISTRY,Gu as NON_LATIN_SITE_LOCALE_CODES,ZL as NavItemSchema,Gi as NextPageCodeErrorSchema,Ax as PAGE_SEO_LOCALIZABLE_FIELD_PATHS,wx as PAGE_SEO_MACHINE_FIELD_PATHS,Gn as PAGE_SLUG_PATTERN,an as PAGE_SLUG_SEGMENT_PATTERN_SOURCE,gr as PAGE_TEMPLATE_BATCH_MAX_ITEMS,lE as PLATFORM_FILE_MUTATION_TOOL_NAMES,iM as PLATFORM_MATERIALIZED_EXEMPTIONS,Lx as PLATFORM_MATERIALIZED_FILES,Mx as PLATFORM_MATERIALIZED_FILE_PATTERNS,sM as PLATFORM_MATERIALIZERS,dc as PLATFORM_OWNED_PAGE_SLUGS,q_ as PLATFORM_OWNED_ROUTE_FILE_PATHS,Dd as PREVIEW_SANDBOX_CLEANUP_CONFLICT_ERROR_CODE,or as PREVIEW_SANDBOX_CLEANUP_LIMIT,T_ as PageDirectoryReconcileFailedPageSchema,ta as PageDirectoryReconcileResultSchema,h1 as PageDirectoryReconcileStateSchema,I_ as PageDirectoryReconcileStatusSchema,zx as PageDiscoveryCoverageEntrySchema,xM as PageDiscoveryCoverageReasonSchema,Fl as PageDiscoveryCoverageSchema,ad as PageNavigationSchema,sa as PageResourceArtifactSchema,M_ as PageResourceComponentReferenceSchema,U_ as PageResourceComponentSchema,j_ as PageResourceDraftPageSchema,L_ as PageResourceDraftSchema,js as PageResourceFinalRouteSchema,F_ as PageResourcePageSchema,N_ as PageResourcePageSelectionSchema,cc as PageResourceRouteMappingSchema,Vo as PageSchema,XL as PageSeoDeclSchema,$o as PageSlugSchema,P_ as PageTargetKindSchema,Xi as PageTargetProjectionHashSchema,nc as PageTargetSchema,C_ as PageTargetSeoSchema,g1 as PageTargetSetSchema,Sr as PageTemplateBatchManifestSchema,b0 as PageTemplateCleanupRequestSchema,E0 as PageTemplateCleanupResponseSchema,_r as PageTemplateCreateItemSchema,S0 as PageTemplateCreateRequestSchema,y0 as PageTemplateCreateResponseSchema,R0 as PageTemplateErrorCodeSchema,Ze as PageTemplateIdSchema,vn as PageTemplatePagePathSchema,f0 as PageTemplatePromoteRequestSchema,x0 as PageTemplatePromoteResponseSchema,Xd as PageTemplateTaskSchema,La as PaletteInputsSchema,u2 as PersistClarifyAnswersRequestSchema,_2 as PersistClarifyAnswersResponseSchema,m2 as PersistGeneratedSitemapDraftRequestSchema,d2 as PersistGeneratedSitemapDraftResponseSchema,Q2 as PersistPreviewSessionRequestSchema,Z2 as PersistPreviewSessionResponseSchema,h2 as PersistSiteDesignPlanRequestSchema,S2 as PersistSiteDesignPlanResponseSchema,p2 as PersistSiteSitemapDraftResponseSchema,r2 as PersistSiteSitemapRequestSchema,l2 as PersistSiteSitemapResponseSchema,oq as PersistSiteSnapshotRequestSchema,rq as PersistSiteSnapshotResponseSchema,FI as PositioningPrefillSchema,Mo as PositioningSourceSchema,P1 as PrepareDesignerPageBodySchema,YG as PrepareDesignerPageResponseSchema,jN as PrepareSiteBuildInitialGenerationBaseRequestSchema,LN as PrepareSiteBuildInitialGenerationBaseResultSchema,XO as PrepareTemplateUpgradeStateRequestSchema,Nb as PrepareTemplateUpgradeStateResponseSchema,Iq as PrepareVersionPreviewRequestSchema,XI as PrepareVersionPreviewResponseSchema,Qc as ProductSearchAppConfigDraftSchema,Sa as ProductSearchAppSlugSchema,SP as ProductSearchContractFixtureSchema,yh as ProductSearchDraftConfigSchema,Ge as ProductSearchFieldNameSchema,fh as ProductSearchFilterMetaSchema,ba as ProductSearchInteractionRequestSchema,Gs as ProductSearchInteractionResponseSchema,hP as ProductSearchPopularTermsReadSchema,Xc as ProductSearchPopularTermsSchema,Sh as ProductSearchPrepareFailureReasonSchema,fa as ProductSearchPrepareFailureSchema,Ih as ProductSearchRequestSchema,kh as ProductSearchResponseSchema,zn as ProductSearchRouteIdSchema,hh as ProductSearchValueShapeSchema,mq as PromoteSiteSnapshotRequestSchema,VI as PromoteSiteSnapshotResponseSchema,yq as PromoteTemplateUpgradeSnapshotRequestSchema,xq as PromoteTemplateUpgradeSnapshotResponseSchema,IU as QualityCheckOutcomeSchema,sp as QualityRunningStatusSchema,_O as REFUSAL_COPY,A2 as REST_API_ENDPOINTS,Px as ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS,Cx as ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS,sR as ReconcileSitePublishDomainOperationDataSchema,iR as ReconcileSitePublishDomainOperationResponseSchema,uq as RecordSnapshotVersionRequestSchema,_q as RecordSnapshotVersionResponseSchema,rN as RecordTemplateUpgradeEventRequestSchema,cN as RecordTemplateUpgradeEventResponseSchema,JO as RecordTemplateUpgradeFailureRequestSchema,eN as RecordTemplateUpgradeFailureResponseSchema,tN as RecordTemplateUpgradeSuccessRequestSchema,nN as RecordTemplateUpgradeSuccessResponseSchema,l1 as RecoverDesignerPageProjectionRequestSchema,p1 as RecoverDesignerPageProjectionResponseSchema,A_ as RecoverDesignerPageProjectionResultSchema,au as ReferencePagePatternSchema,ys as ReferenceSignalsSchema,pI as RegisterMediaResourceReferenceRequestSchema,dI as RegisterMediaResourceReferenceResponseSchema,sP as RegisterWorkflowTaskCommandRequestSchema,mh as RegisterWorkflowTaskRequestSchema,xv as RegisterWorkspacePageCheckpointRequestSchema,Sq as ReleaseTemplateUpgradeLockRequestSchema,fq as ReleaseTemplateUpgradeLockResponseSchema,oP as ReplaceCrawlWorkflowTaskCommandRequestSchema,ph as ReplaceCrawlWorkflowTaskRequestSchema,aP as ReplaceWorkflowTaskCommandRequestSchema,lh as ReplaceWorkflowTaskRequestSchema,Kj as ResolvedFieldSchema,fL as ResolvedFormFieldSchema,k2 as RestApiMethodSchema,Rq as RestoreSiteSnapshotResponseSchema,HF as ReturnWorkbenchResponseSchema,QL as RootLayoutMetadataSchema,Zp as RouteGenerationCardSchema,oS as RuleEngineInputSchema,lS as RuleEngineScoreRecordSchema,Aa as RuleScoreDimensionKeySchema,mS as RuleScoreDimensionSchema,Nn as SELECTABLE_SITE_LOCALE_CODES,CT as SITEMAP_RESOLVER_MAX_BLOCK_TARGETS,PT as SITEMAP_RESOLVER_MAX_PAGE_TARGETS,ON as SITE_BUILD_CONTEXT_FILE_PATH,NN as SITE_BUILD_CONTEXT_MAX_BYTES,Qg as SITE_BUILD_STATUSES,Bc as SITE_BUILD_STATUS_CODES,Zg as SITE_DEPLOYMENT_STATUSES,Kc as SITE_DEPLOYMENT_STATUS_CODES,Ya as SITE_DESIGN_DENSITY_IDS,$t as SITE_DESIGN_NOTES_END,pn as SITE_DESIGN_NOTES_START,$m as SITE_DESIGN_RADIUS_IDS,gD as SITE_EDIT_DURABLE_HISTORY_CAPABILITY,a_ as SITE_EDIT_MATERIALIZATION_MAX_FILE_CONTENT_BYTES,Hi as SITE_EDIT_MATERIALIZATION_MAX_FILE_COUNT,$i as SITE_EDIT_MATERIALIZATION_MAX_TOTAL_CONTENT_BYTES,Ac as SITE_EDIT_PAGE_COMPOSITION_SCHEMA_VERSION,pw as SITE_EDIT_PAGE_COMPOSITION_V2_CAPABILITY,Qf as SITE_EDIT_RUNTIME_CONTAINER_TAGS,Zf as SITE_EDIT_RUNTIME_TEXT_TAGS,Xf as SITE_EDIT_RUNTIME_VOID_ELEMENT_TAGS,nw as SITE_EDIT_SIGNED_MUTATION_CAPABILITY,du as SITE_EDIT_SOURCE_ALLOWED_APP_FILES,Ir as SITE_EDIT_SOURCE_ALLOWED_DIRS,lu as SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES,pu as SITE_EDIT_SOURCE_ALLOWED_SYSTEM_FILES,Li as SITE_EDIT_SOURCE_DELETE_CAPABILITY,uu as SITE_EDIT_TEXT_SOURCE_EXTENSIONS,il as SITE_EXTRA_REQUIREMENT_MAX_LENGTH,Zv as SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE,Jv as SITE_HAS_SUBSITES_ERROR_CODE,DI as SITE_INITIAL_REVIEW_CARD_KEYS,DC as SITE_LEADING_BODY_TOKEN,OC as SITE_LEADING_HEADING_TOKEN_NAMES,Nu as SITE_LOCALE_CODES,YL as SITE_LOCALIZATION_STRUCTURES,CG as SITE_PLANNING_FROZEN_ERROR_CODE,vG as SITE_PLANNING_LOCKED_ERROR_CODE,jG as SITE_SITEMAP_DRAFT_OPERATION_MISMATCH_ERROR_CODE,NG as SITE_SITEMAP_DRAFT_STALE_ERROR_CODE,DG as SITE_STRUCTURE_CONFIRMATION_REQUIRED_ERROR_CODE,OG as SITE_STRUCTURE_CONFIRMATION_STALE_ERROR_CODE,Fp as SITE_STRUCTURE_INVALID_ERROR_CODE,vC as SITE_WEIGHT_TOKEN_NAMES,Kb as SITE_WORKFLOW_PROGRESS_STATUSES,Hb as SITE_WORKFLOW_PROGRESS_STEP_STATUSES,Jg as SITE_WORKFLOW_STATUSES,zc as SITE_WORKFLOW_STATUS_CODES,w2 as SSE_STREAMS,Bu as STEP5_KEYWORD_CATEGORIES,zu as STEP5_OPTIONAL_STRATEGY_KEYS,Ps as STEP5_REQUIRED_STRATEGY_COUNT,Ln as STEP5_REQUIRED_STRATEGY_KEYS,n_ as STEP5_SSE_EVENT_NAMES,je as STEP5_STRATEGY_COUNT,nn as STEP5_STRATEGY_KEYS,Nr as STEP5_STRATEGY_OPTION_IDS,Qm as STEP6_AI_THEME_IDS,Qa as STEP6_AI_THEME_PRESETS,Zm as STEP6_GENERATED_THEME_ID_PATTERN,ub as SUBSITE_GLOSSARY_ENTRY_MAX_CHARS,_b as SUBSITE_GLOSSARY_MAX_ENTRIES,wb as SUBSITE_MOUNT_PATH_PATTERN,bb as SUBSITE_PALETTE_NOTE_MAX_CHARS,Pb as SUBSITE_RESERVED_MOUNT_SEGMENTS,yA as SUPPORTED_SITE_LOCALES,Jt as SandboxSessionIdSchema,wn as SandboxSessionSchema,Cd as SandboxSessionStatusSchema,qG as SaveBriefDraftRequestSchema,tq as SaveBriefDraftResponseSchema,MR as SaveGa4BindingDataSchema,gF as SaveGa4BindingRequestSchema,hF as SaveGa4BindingResponseSchema,Gj as SaveSiteExtraRequirementRequestSchema,i2 as SaveSiteSitemapDraftRequestSchema,a2 as SaveSiteSitemapDraftResponseSchema,rI as SearchUnsplashMediaQuerySchema,cI as SearchUnsplashMediaResponseSchema,sd as SiteBreadcrumbPlacementSchema,ny as SiteBuildContextFileSchema,ty as SiteBuildContextPayloadSchema,ey as SiteBuildContextProvenanceSchema,Jb as SiteBuildContextProvenanceSourceSchema,ua as SiteBuildStatusSchema,eD as SiteDeletionBlockedDetailsSchema,_a as SiteDeploymentStatusSchema,Ri as SiteDesignContextSchema,qI as SiteDesignDensitySchema,WI as SiteDesignMotionLevelSchema,Cn as SiteEditAdvisorySchema,Xs as SiteEditBoundaryKindSchema,hf as SiteEditCapabilityConstraintSchema,_f as SiteEditCapabilityModeSchema,Ys as SiteEditCapabilityModeViewSchema,iD as SiteEditCapabilityReadRequestSchema,H_ as SiteEditClassNameSourceDiagnosticSchema,gt as SiteEditClassNameSourceRangeSchema,fc as SiteEditClassNameSourceSchema,G1 as SiteEditClassNameSourceStyleContextSchema,Sc as SiteEditClassNameSourceStylesheetSchema,aa as SiteEditClassNameSourceWriteIntentSchema,j1 as SiteEditCommandDiagnosticSchema,K_ as SiteEditCommandErrorSchema,z as SiteEditCompositionContextSchema,he as SiteEditCompositionSelectorSchema,gf as SiteEditConstraintKindSchema,Fg as SiteEditDeletePageSourceOutputSchema,qf as SiteEditDynamicConfidenceSchema,Bf as SiteEditDynamicDataBindingSchema,Om as SiteEditDynamicDataDetailSchema,Nm as SiteEditDynamicDataSummarySchema,Wf as SiteEditDynamicEvidenceSchema,Dm as SiteEditDynamicSourceKindSchema,Ff as SiteEditDynamicSourceTypeSchema,Gf as SiteEditDynamicTargetKindSchema,Fa as SiteEditEffectiveWriteTargetSchema,pD as SiteEditEventSchema,vi as SiteEditExecutionSceneSchema,Js as SiteEditExternalSourceKindSchema,K1 as SiteEditGetClassNameSourceCommandResultSchema,W1 as SiteEditGetClassNameSourceInputSchema,B1 as SiteEditGetClassNameSourceResultSchema,$D as SiteEditGetDocumentInputSchema,VD as SiteEditGetObjectEditContextInputSchema,pA as SiteEditGetSourceFileInputSchema,lA as SiteEditGetSourceTreeInputSchema,q1 as SiteEditGetStyleContextInputSchema,Zs as SiteEditHistoryProvenanceSchema,xf as SiteEditHistoryReadOnlyRecoveryStatusSchema,Sf as SiteEditHistoryRecoveryCodeSchema,ff as SiteEditHistoryRecoveryDiagnosticSchema,SD as SiteEditHistoryResultSchema,hD as SiteEditHistoryStatusModeSchema,Rf as SiteEditHistoryStatusSchema,bf as SiteEditHistoryUnavailableReasonSchema,Ef as SiteEditHistoryUnavailableStatusSchema,yf as SiteEditHistoryWritableStatusSchema,mO as SiteEditInitializeSessionInputSchema,Lg as SiteEditInsertNodeSpecSchema,Ug as SiteEditInsertPageResourceOutputSchema,p_ as SiteEditMaterializationDataRequirementsSchema,l_ as SiteEditMaterializationEntrySchema,m_ as SiteEditMaterializationExportSchema,c_ as SiteEditMaterializationFileSchema,Gr as SiteEditMaterializationPathTemplateSchema,Wt as SiteEditMaterializationSchema,Nc as SiteEditMaterializedComponentNodeSpecSchema,jg as SiteEditMoveNodeTargetSchema,Oc as SiteEditMoveTargetSchema,qn as SiteEditMutationContextSchema,Qs as SiteEditNodeCapabilitySnapshotSchema,XD as SiteEditObjectCapabilitiesSchema,ZD as SiteEditObjectDetailSchema,eO as SiteEditObjectEditContextSchema,tO as SiteEditObjectStyleDetailSchema,JD as SiteEditObjectSummarySchema,Aw as SiteEditOperationCommandResultSchema,jc as SiteEditOperationErrorCodeSchema,Lc as SiteEditOperationErrorSchema,Gg as SiteEditOperationOutputSchema,Mg as SiteEditOperationParamsSchema,la as SiteEditOperationPayloadSchema,ma as SiteEditOperationRequestSchema,Og as SiteEditOperationResultTargetSchema,rn as SiteEditOperationSelectionRefSchema,Uf as SiteEditOperationSummarySchema,wg as SiteEditOperationTargetSchema,Kn as SiteEditOperationTypeSchema,Ht as SiteEditOperationValueSchema,Kf as SiteEditPageCompositionActionScopeSchema,dw as SiteEditPageCompositionAnyVersionSchema,dg as SiteEditPageCompositionAtomicKindSchema,hg as SiteEditPageCompositionBoundaryModeSchema,ig as SiteEditPageCompositionBusinessMemberSchema,ng as SiteEditPageCompositionContainerSchema,Bn as SiteEditPageCompositionDiagnosticSchema,Ms as SiteEditPageCompositionErrorCodeSchema,Ic as SiteEditPageCompositionPlacementTargetSchema,ag as SiteEditPageCompositionPlacementUnitSchema,lg as SiteEditPageCompositionRuntimeRefSchema,mg as SiteEditPageCompositionSchema,pg as SiteEditPageCompositionSourceMemberKindSchema,sg as SiteEditPageCompositionSourceMemberSchema,wc as SiteEditPageCompositionSourceRangeSchema,rg as SiteEditPageCompositionSupportedSchema,cg as SiteEditPageCompositionUnsupportedSchema,gg as SiteEditPageCompositionV2BusinessMemberSchema,ug as SiteEditPageCompositionV2ContainerSchema,fg as SiteEditPageCompositionV2PlacementRelationSchema,yg as SiteEditPageCompositionV2PlacementSchema,Sg as SiteEditPageCompositionV2PlacementUnitSchema,Ig as SiteEditPageCompositionV2Schema,_g as SiteEditPageCompositionV2SourceMemberSchema,Eg as SiteEditPageCompositionV2SupportedSchema,Rg as SiteEditPageCompositionV2UnsupportedSchema,bg as SiteEditPageCompositionV2WriteModeSchema,xg as SiteEditPageCompositionVisualAnchorSchema,og as SiteEditPagePlacementOptionSchema,Rc as SiteEditPagePlacementSchema,kc as SiteEditPageUnitResultTargetSchema,Tc as SiteEditPageUnitTargetSchema,vf as SiteEditPatchPlanPatchSchema,AD as SiteEditPatchPlanSchema,Ga as SiteEditPropertiesSchema,ra as SiteEditPropertyChangeSchema,wf as SiteEditPropertyCreationSchema,kf as SiteEditPropertyItemSchema,If as SiteEditPropertyResolutionSchema,Tf as SiteEditPropertySourceSchema,Af as SiteEditPropertySpreadSchema,Zn as SiteEditProvenanceChainSchema,$f as SiteEditProvenanceHopSchema,YD as SiteEditRenderDocumentSchema,Qn as SiteEditRenderEntryRefSchema,zf as SiteEditRenderEntrySchema,vm as SiteEditRenderPageCompositionSchema,Lf as SiteEditRenderPageCompositionSupportedSchema,Mf as SiteEditRenderPageCompositionUnsupportedSchema,jf as SiteEditRenderPagePlacementSchema,sw as SiteEditRequiredMutationContextEnvelopeSchema,uA as SiteEditResolveSourceLocationInputSchema,Lm as SiteEditSemanticSourceSchema,yc as SiteEditSetPropsParamsSchema,kw as SiteEditSignedOperationRequestSchema,Tr as SiteEditSourceDeleteCapabilitySchema,gu as SiteEditSourceDirectoryPathSchema,yu as SiteEditSourceFileBinaryPreviewUnavailableReasonSchema,xu as SiteEditSourceFileBinaryResponseSchema,cA as SiteEditSourceFileKindSchema,hu as SiteEditSourceFileListItemSchema,dA as SiteEditSourceFileResponseSchema,bu as SiteEditSourceFileTextResponseSchema,ca as SiteEditSourceIdentitySchema,Eu as SiteEditSourceLocationRangeSchema,_A as SiteEditSourceLocationSchema,Yf as SiteEditSourceLocatorRangeSchema,Ba as SiteEditSourceLocatorSchema,Ie as SiteEditSourcePathSchema,Ng as SiteEditSourceSiblingMoveTargetSchema,kr as SiteEditSourceTreeNodeSchema,mA as SiteEditSourceTreeResponseSchema,Su as SiteEditSourceTreeTruncationReasonSchema,fu as SiteEditSourceTreeTruncationSchema,Dc as SiteEditStyleBreakpointSchema,xc as SiteEditStyleDraftPropertySchema,QD as SiteEditStyleModelSchema,Cc as SiteEditStylePropertySchema,Mm as SiteEditStyleSourceSchema,vc as SiteEditStyleStateModeSchema,Wa as SiteEditTextSegmentSchema,jm as SiteEditTextSourceSchema,Hf as SiteEditWriteTargetSchema,qj as SiteExtraRequirementResponseSchema,Ey as SiteExtraRequirementSchema,Av as SiteGenerationLedgerResponseSchema,k as SiteIdSchema,Up as SiteInitialReviewCardKeySchema,OI as SiteInitialReviewCardSchema,XF as SiteInitialReviewCardsResponseSchema,LI as SiteInitialReviewCardsSchema,Mp as SiteInitialReviewCheckSchema,jI as SiteInitialReviewDetailSchema,CI as SiteInitialReviewErrorSchema,MI as SiteInitialReviewEventCursorSchema,ZF as SiteInitialReviewEventSchema,NI as SiteInitialReviewMetricSchema,PI as SiteInitialReviewPhaseSchema,YF as SiteInitialReviewStatusResponseSchema,vI as SiteInitialReviewStatusSchema,JF as SiteInitialReviewStreamErrorSchema,UI as SiteInitialReviewSummarySchema,Qb as SiteLauncherPermissionSchema,Te as SiteLocaleSchema,Bq as SiteMediaIntentSchema,Kk as SiteOperationLockIdSchema,qb as SitePreviewActivateErrorCodeSchema,Bb as SitePreviewActivateFailedSchema,Wb as SitePreviewActivateReadySchema,gN as SitePreviewActivateResponseSchema,NU as SitePublishDomainCheckDataSchema,OU as SitePublishDomainCheckRequestSchema,jU as SitePublishDomainCheckResponseSchema,LU as SitePublishDomainOperationDataSchema,MU as SitePublishDomainOperationResponseSchema,UU as SitePublishDomainReconcileOperationResponseSchema,FU as SitePublishDomainRemediationConfirmRequestSchema,GU as SitePublishDomainRemediationConfirmResponseSchema,yi as SitePublishQualityTaskStatusSchema,dU as SitePublishRepairInputItemSchema,KE as SitePublishRepairResultItemSchema,ip as SitePublishRepairResultSchema,uU as SitePublishRepairTaskSnapshotSchema,np as SitePublishRepairTaskStatusSchema,SU as SitePublishWorkflowActiveResponseSchema,_s as SitePublishWorkflowIdSchema,HE as SitePublishWorkflowMutationDataSchema,fU as SitePublishWorkflowMutationResponseSchema,$E as SitePublishWorkflowPublishDataSchema,bU as SitePublishWorkflowPublishResponseSchema,VE as SitePublishWorkflowQualityDataSchema,yU as SitePublishWorkflowQualityResponseSchema,jt as SitePublishWorkflowRecordSchema,hU as SitePublishWorkflowRevisionRequestSchema,ME as SitePublishWorkflowStatusSchema,UE as SitePublishWorkflowStepSchema,Ut as SiteRecordSchema,Hk as SiteTemplateUpgradeStateIdSchema,N2 as SiteThreadListQuerySchema,j2 as SiteThreadListResponseSchema,U2 as SiteThreadResponseSchema,sr as SiteVersionIdSchema,YI as SiteVersionListItemSchema,wi as SiteVersionRecordSchema,ot as SiteWorkflowIdSchema,Yb as SiteWorkflowProgressDataSchema,xN as SiteWorkflowProgressResponseSchema,zb as SiteWorkflowProgressStatusSchema,Vb as SiteWorkflowProgressStepSchema,$b as SiteWorkflowProgressStepStatusSchema,ch as SiteWorkflowRecordSchema,Xw as SiteWorkflowSnapshotResponseSchema,ha as SiteWorkflowSnapshotSchema,eh as SiteWorkflowStatusSchema,ar as SiteWorkflowTaskRefIdSchema,Qw as SiteWorkflowTaskRefResponseSchema,Vc as SiteWorkflowTaskRefSchema,Zq as SitemapAddBlockInputSchema,Yo as SitemapAnswerSchema,Xq as SitemapChangeBlockVariantInputSchema,OT as SitemapDeleteBlockInputSchema,yT as SitemapDraftBlockSchema,xT as SitemapDraftPageSchema,_d as SitemapDraftRecordSchema,bn as SitemapDraftSchema,DT as SitemapEditActorSchema,LT as SitemapEditErrorCodeSchema,UT as SitemapEditFailureSchema,jT as SitemapEditOperationSchema,e2 as SitemapEditResultSchema,MT as SitemapEditSuccessSchema,n2 as SitemapGenerationInputSchema,BT as SitemapGenerationOutcomeSchema,KT as SitemapGenerationReasonSchema,cd as SitemapGenerationStageSchema,we as SitemapIdSchema,FT as SitemapIntentPageSchema,Vq as SitemapModelOutputSchema,RT as SitemapModelPageSchema,Yq as SitemapMoveBlockInputSchema,fT as SitemapNavigationHrefSchema,We as SitemapNodeIdSchema,ud as SitemapRecordSchema,Hq as SitemapResolverRequestSchema,$q as SitemapResolverResponseSchema,vT as SitemapResolverTargetsSchema,rd as SitemapRunInputSchema,In as SitemapSchema,TT as SitemapSourceProvenanceSchema,s2 as SitemapStreamEventSchema,bM as SitemapTaskCreateRequestSchema,IM as SitemapTaskCreateResponseSchema,Jx as SitemapTaskFailureErrorCodeSchema,TM as SitemapTaskResponseSchema,NT as SitemapUpdateBlockInstructionInputSchema,Qq as SitemapUpdateBlockPropsInputSchema,sT as SitemapUserChoiceSchema,Rn as SkillSelectionSchema,aT as SkillSelectionSourceSchema,Ed as SnapshotContentHashSchema,$d as SnapshotEditChangesSchema,Hd as SnapshotEditPageChangeSchema,zd as SnapshotEditSectionChangeSchema,Oe as SnapshotFilePathSchema,I as SnapshotIdSchema,It as SnapshotRecordSchema,Xp as SnapshotStatusSchema,wv as StartFillInRequestSchema,nq as StartFillInResponseSchema,IR as StartGa4AuthDataSchema,rF as StartGa4AuthRequestSchema,cF as StartGa4AuthResponseSchema,Ao as StartGscAuthDataSchema,op as StartGscAuthRequestSchema,rp as StartGscAuthResponseSchema,rP as StartSiteBuildRequestSchema,MN as StartSiteBuildResponseSchema,sy as StartSiteBuildResultSchema,_U as StartSitePublishWorkflowRequestSchema,P2 as StartWorkspaceRunRequestSchema,C2 as StartWorkspaceRunResponseSchema,nm as Step2AiCrawlabilityAssessmentSchema,Gh as Step2FinalResultDataSourceSchema,Ws as Step2FinalResultRequestSchema,YP as Step2FinalResultResponseSchema,VP as Step2FinalResultSaveResponseSchema,Fh as Step2FinalResultSaveResultSchema,Ra as Step2FinalResultTypeSchema,Wh as Step2FinalResultViewSchema,tm as Step2FinalScanCardKeySchema,Ia as Step2FinalScanCardSchema,Uh as Step2FinalScanResultSchema,Jn as Step2KnowledgeOpaqueIdSchema,BN as Step2KnowledgeScopeSchema,wt as Step2PageRoleSchema,ZP as Step2PageSelectionRequestSchema,JP as Step2PageSelectionResponseSchema,jh as Step2SiteInitializationCrawlerErrorCodeSchema,Nh as Step2SiteInitializationStatusSchema,$P as Step2SiteInitializationTaskResponseSchema,Lh as Step2SiteInitializationTaskSchema,Ta as Step3AgentAnalysisSchema,Yh as Step3AnalysisFindingSchema,oC as Step3AnalysisJobResponseSchema,om as Step3AnalysisJobSchema,im as Step3AnalysisJobStatusSchema,rC as Step3AnalysisLatestResponseSchema,sm as Step3AnalysisProgressSchema,Zh as Step3AnalysisResultSchema,aC as Step3AnalysisScheduleResponseSchema,Vh as Step3AnalysisScheduleSchema,cC as Step3AnalysisSseFrameSchema,sC as Step3AnalysisStartRequestSchema,am as Step3AnalysisSummarySchema,$h as Step3AnalystSchema,iC as Step3AnalystsResponseSchema,dC as Step4DiagnosisResponseSchema,Cs as Step5ActiveStrategyKeySchema,FA as Step5CommitStrategyRequestSchema,GA as Step5CommitStrategyResponseSchema,e_ as Step5CommittedVersionSchema,Mn as Step5DecisionSelectionIdSchema,Yu as Step5EvidenceReferenceSchema,Xu as Step5GenerationStatusSchema,Zu as Step5JobStatusSchema,ks as Step5KeywordCategorySchema,Ku as Step5KeywordEntryEditSchema,jn as Step5KeywordEntrySchema,qi as Step5KeywordLibrarySchema,wA as Step5KeywordSearchBodySchema,As as Step5KeywordSelectionSchema,Os as Step5MarketCountrySchema,Ds as Step5MarketTypeSchema,Or as Step5OptionPresentationSchema,Bi as Step5OutputLocaleSchema,Hu as Step5PromotedBusinessSchema,Ns as Step5PromotedBusinessesSchema,LA as Step5RegenerateItemRequestSchema,MA as Step5SaveDecisionRequestSchema,UA as Step5SaveDecisionResponseSchema,GT as Step5SitemapDecisionSchema,WT as Step5SitemapRunInputSchema,qT as Step5SitemapSourceSchema,t2 as Step5SitemapStartRequestSchema,NA as Step5StartStrategyRequestSchema,jA as Step5StartStrategyResponseSchema,Qu as Step5StrategyDecisionInputSchema,zi as Step5StrategyDecisionSchema,Ki as Step5StrategyItemSchema,Mr as Step5StrategyJobSchema,vs as Step5StrategyKeySchema,jr as Step5StrategyOptionIdSchema,$u as Step5StrategyOptionSchema,Lr as Step5StrategyPlanSchema,t_ as Step5StrategySnapshotDataSchema,WA as Step5StrategySseFrameSchema,Ju as Step5StrategyVersionSnapshotSchema,Vu as Step5StructureDetailSchema,_y as Step6AiThemeCandidateSchema,ii as Step6ColorSeedsSchema,vj as Step6DesignAgentRecommendationsResponseSchema,Ij as Step6DesignRecommendationGenerationInputSchema,eo as Step6DesignRecommendationModelOutputSchema,gy as Step6DesignRecommendationSchema,yj as Step6DesignRecommendationsRequestSchema,xj as Step6DesignRecommendationsResponseSchema,sl as Step6DesignSelectionSchema,nl as Step6GeneratedThemeCardSchema,yy as Step6GptDesignRecommendationModelOutputSchema,Tv as StopWorkspaceGenerationRequestSchema,kv as StopWorkspaceGenerationResponseSchema,DO as SubsiteCopyEstimateRequestSchema,OO as SubsiteCopyEstimateResponseSchema,Ib as SubsiteDiffEstimateShape,IO as SubsiteGlossariesSchema,hb as SubsiteGlossaryEntrySchema,ei as SubsiteHexColorSchema,HO as SubsiteMountPathSchema,Rb as SubsitePageEstimateSchema,kO as SubsitePaletteLocalizationSchema,Sb as SubsitePaletteModeSchema,fb as SubsitePaletteSeedsSchema,TO as SubsiteSiteInfoSchema,LO as SubsiteSyncDiffComputeRequestSchema,MO as SubsiteSyncDiffComputeResponseSchema,kb as SubsiteSyncDiffErrorCodeSchema,UO as SubsiteSyncDiffErrorResponseSchema,WO as SubsiteVisibleTextExportRequestSchema,BO as SubsiteVisibleTextExportResponseSchema,Xg as TASK_EXECUTION_STATUSES,Hc as TASK_EXECUTION_STATUS_CODES,bq as TEMPLATE_UPGRADE_LOCK_LOST_ERROR_CODE,Za as THEME_PRESETS,Xm as THEME_PRESET_IDS,Wc as TaskExecutionStatusSchema,Ub as TemplateUpgradeCasOutcomeSchema,qm as TemplateUpgradeErrorCodeSchema,Fb as TemplateUpgradeOutcomeCountsSchema,Lb as TemplateUpgradeOutcomeSchema,Gb as TemplateUpgradeSnapshotDeletionCandidateSchema,gn as TemplateUpgradeStateSchema,Db as TemplateUpgradeStatusSchema,Mb as TemplateUpgradeValidationStageSchema,et as TemplateVersionSchema,gq as TryAcquireTemplateUpgradeLockRequestSchema,hq as TryAcquireTemplateUpgradeLockResponseSchema,MS as TypeInputsSchema,cb as USER_STOPPED_RUN_ERROR_CODES,vp as UnsplashDownloadLocationSchema,Cp as UnsplashMediaAssetSchema,GG as UpdateBriefRequestSchema,eq as UpdateBriefResponseSchema,g2 as UpdateClarifyArchetypeRequestSchema,b1 as UpdateCmsSeoSyncStateRequestSchema,cq as UpdateCurrentSnapshotManifestRequestSchema,S1 as UpdatePageDirectoryReconcileStateRequestSchema,gU as UpdateSitePublishWorkflowStepRequestSchema,FG as UpdateSiteRequestSchema,M2 as UpdateSiteThreadRequestSchema,Jw as UpdateSiteWorkflowWebsiteRequestSchema,Ej as UpdateStep6DesignSelectionRequestSchema,Rj as UpdateStep6DesignSelectionResponseSchema,iP as UpdateWorkflowTaskStatusRequestSchema,iI as UploadMediaLibraryAssetResponseSchema,nU as UpstreamPromptTemplateCatalogDataSchema,tU as UpstreamPromptTemplateConsumeDataSchema,Wx as UrlListCrawlerTaskCreateRequestSchema,$k as UsageRecordIdSchema,mI as UseUnsplashMediaRequestSchema,lI as UseUnsplashMediaResponseSchema,Lk as UserIdSchema,mR as VCP_GSC_STATES,ko as VcpGscStateSchema,GE as VcpQualityRemediationItemSchema,tp as VcpQualityResultSchema,Fo as VisualHintsSchema,nT as VisualThemeSchema,PS as WEIGHT_STYLE_IDS,_m as WEIGHT_STYLE_PRESETS,Yw as WORKFLOW_DEFINITIONS_V1,ga as WORKFLOW_DEFINITION_REGISTRY,$g as WORKFLOW_FLOW_TYPES,th as WORKFLOW_MENU_STATES,Vg as WORKFLOW_NODE_CODES,Yg as WORKFLOW_TASK_TYPES,kP as WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE,OP as WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_ERROR_CODE,vP as WORKSPACE_ATTACHMENT_CAPTURE_BUSY_ERROR_CODE,CP as WORKSPACE_ATTACHMENT_CAPTURE_FAILED_ERROR_CODE,DP as WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT_ERROR_CODE,NP as WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE_ERROR_CODE,TP as WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE,Ah as WORKSPACE_ATTACHMENT_MEDIA_TYPES,EP as WORKSPACE_ATTACHMENT_TARGET_BASE64_BYTES,IP as WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE,xP as WORKSPACE_ATTACHMENT_UNBOUND_TTL_MS,RP as WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE,PP as WORKSPACE_ATTACHMENT_URL_REJECTED_ERROR_CODE,pv as WORKSPACE_CHECK_INCOMPLETE_ERROR_CODE,pE as WORKSPACE_FILE_MUTATION_TOOL_NAMES,uv as WORKSPACE_FILL_IN_INTERRUPTED_ERROR_CODE,dv as WORKSPACE_GENERATION_STOPPED_ERROR_CODE,mv as WORKSPACE_MAX_PAGE_ATTEMPTS,cv as WORKSPACE_MAX_RESUME_COUNT,rv as WORKSPACE_RUN_HEARTBEAT_INTERVAL_MS,ov as WORKSPACE_RUN_LEASE_MS,_v as WORKSPACE_RUN_LEASE_SUPERSEDED_ERROR_CODE,gv as WORKSPACE_RUN_NOT_ACTIVE_ERROR_CODE,lv as WORKSPACE_RUN_RESUME_EXHAUSTED_ERROR_CODE,wP as WORKSPACE_URL_CAPTURE_WINDOW_MS,B2 as WORKSPACE_WEBSOCKET_CONTRACT,Ke as WeightStyleIdSchema,Gc as WorkflowClientCapabilitiesSchema,$c as WorkflowDefinitionVersionSchema,cn as WorkflowFlowTypeSchema,rh as WorkflowMenuItemSchema,nh as WorkflowMenuStateSchema,At as WorkflowNodeCodeSchema,qc as WorkflowTaskTypeSchema,LP as WorkspaceAttachmentFromUrlRequestSchema,xa as WorkspaceAttachmentMediaTypeSchema,jP as WorkspaceAttachmentSchema,Sk as WorkspaceClientMessageSchema,_I as WorkspaceDesignApplyRequestSchema,gI as WorkspaceDesignApplyResponseSchema,hI as WorkspaceDesignCurrentResponseSchema,Qo as WorkspaceDiagnosticSchema,kk as WorkspaceDirectEditFileSchema,Tk as WorkspaceDirectEditPathSchema,kd as WorkspaceDirectEditPostActionSchema,H2 as WorkspaceDirectEditRequestSchema,V2 as WorkspaceDirectEditResponseSchema,Zo as WorkspaceExecutionDiagnosticsSchema,f2 as WorkspaceExecutionPlanSchema,Rr as WorkspaceGenerationLedgerEventSchema,On as WorkspaceGenerationLedgerSchema,Ik as WorkspaceMediaRequestSchema,Jd as WorkspaceOmissionKindSchema,eu as WorkspaceOmissionReasonSchema,Er as WorkspaceOmissionSchema,Im as WorkspacePageCheckpointSchema,nu as WorkspacePageOutcomeSchema,tu as WorkspacePageResultSchema,tr as WorkspacePlanDependencySchema,Sd as WorkspacePlanSummarySchema,ek as WorkspacePlanTaskKindSchema,er as WorkspacePlanTaskSchema,Wg as WorkspaceResourceKindSchema,Kg as WorkspaceResourceNavigationSelectionSchema,Fc as WorkspaceResourceOperationClientMessageSchema,bd as WorkspaceResourceOperationCompletionSchema,Bg as WorkspaceResourceOperationSummarySchema,zg as WorkspaceResourceOperationTransientInputSchema,Us as WorkspaceResourcePageCopySchema,Rv as WorkspaceRunControlInputResponseSchema,bv as WorkspaceRunHeartbeatRequestSchema,yv as WorkspaceRunHeartbeatResponseSchema,Pi as WorkspaceRunKindSchema,JS as WorkspaceRunResumePrincipalSchema,hk as WorkspaceSelectedComponentSchema,bk as WorkspaceServerMessageSchema,Jq as WorkspaceSitemapEditRequestSchema,gk as WorkspaceSocketDescriptorSchema,Dk as WorkspaceSourceFileBinaryResponseSchema,Ck as WorkspaceSourceFileKindSchema,wd as WorkspaceSourceFileListItemSchema,Y2 as WorkspaceSourceFilePathQuerySchema,X2 as WorkspaceSourceFileResponseSchema,vk as WorkspaceSourceFileTextResponseSchema,Ad as WorkspaceSourcePathSchema,VT as WorkspaceSuggestionSchema,gd as WorkspaceSuggestionsSchema,YT as WorkspaceSuggestionsSourceSchema,fd as WorkspaceTaskCountsSchema,W2 as WorkspaceWebSocketMessageSchema,q2 as WorkspaceWebSocketMessageTypeSchema,Jo as WorkspaceWorkerGroupSchema,Xo as WorkspaceWorkerPhaseSchema,b2 as WorkspaceWorkerResultSchema,Qt as WorkspaceWorkerStatusSchema,nL as applicationTemplateCatalogDataSchema,tL as applicationTemplateConsumeDataSchema,eL as applicationTemplateV1Schema,yC as assertDeploymentTransition,yF as assertFillInTargetsOmitted,dP as assertSiteBuildStatusTransition,pP as assertTaskExecutionStatusTransition,Oa as availableFontWeights,df as breadcrumbClassName,uM as buildCmsIdentityHeaders,fF as buildE2bBrowserPreviewUrl,RU as buildFinalSitePublishQualityResult,Tj as buildStep6FallbackThemeCards,kN as canEnterLauncher,AN as canPublishSite,bo as canonicalizeFormDesignJson,sU as canonicalizeLauncherPromptTemplateOperation,gc as canonicalizePageSlug,ZC as checkGlobalsCssEdit,oa as classifySiteEditPropertyName,o1 as cmsPagePreviewUrlPath,zA as compareTemplateVersions,PD as composeSiteEditRepeatInstanceKey,HL as computeFormDesignOperationFingerprint,ji as computeSiteEditCompositionKey,tg as computeSiteEditSourceIdentityKey,us as containsSensitiveData,j0 as countLedgerAccessiblePages,L0 as countLedgerProcessedPages,$R as countSitemapStructure,z_ as createSiteEditCommandFailureSchema,hc as createSiteEditCommandResultSchema,ia as createSiteEditCommandSuccessSchema,o2 as createSiteSitemapDraftCreationKey,BP as createSitemapResolverAnswerSheetSchema,Aj as defaultStep6Selection,dR as deriveVcpGscState,uR as doesGscPropertyMatchDomain,QR as estimateNavLabelWidth,uh as findWorkflowDefinition,dh as findWorkflowDefinitionInRegistry,Ca as fontStack,kx as formDesignOperationFingerprintInput,FS as formatSiteDesignNotes,Vv as generateDetailBreadcrumb,xC as getDeploymentHappyPathTransitions,fC as getDeploymentTransitionPredecessors,SC as getDeploymentTransitionTargets,um as getFontPairing,Ym as getMotionPreset,bi as getQualityCheckOutcome,Jm as getSiteDesignThemeRadius,Ui as getSiteEditSourceDeleteProtectionReason,xU as getSitePublishRepairItems,TU as getSitePublishSafetyAssessment,mj as getThemePreset,_h as getWorkflowDefinition,mP as getWorkflowNodeIndex,k0 as hasAnyBusinessFact,Xn as hasDesignTokenBlock,wO as hasLockedSeeds,zL as hashAffectedFormDesignFiles,KL as hashCmsFormSchemaProjection,di as hashFormDesignJson,BL as hashFormSpec,WR as homeLabelForLocale,HM as isCanonicalFileMutationToolName,uc as isCanonicalPageSlug,Zb as isCmsMainProductsWithinLimit,SI as isCmsNavigationHref,a1 as isCmsPageSelectable,Hr as isCmsTemplateUrlPath,H0 as isConsentGranted,_S as isDeploymentActiveStatus,bC as isDeploymentTerminalStatus,pb as isExactEditEngineVersion,i0 as isExternalSiteEditInfrastructureReason,dO as isFontLicenseBuildErrorCode,kL as isFormSpecLocalizableFieldPath,qA as isKnownStep5SseEventName,Hv as isMigrationProductsPresetBlockLabel,zv as isMigrationProductsPresetPageTitle,dE as isModelFileMutationToolName,vu as isNextPageCodeErrorCode,RA as isNonLatinSiteLocale,hs as isPageTemplateCandidateEntryPath,aM as isPlatformMaterializedFile,vb as isReservedSubsiteMountSegment,Iu as isSiteEditDesignDocumentPath,r_ as isSiteEditMaterializationPathTemplate,sb as isSiteEditRuntimeContainerTag,ib as isSiteEditRuntimeTextTag,sO as isSiteEditRuntimeVoidElementTag,gA as isSiteEditSourceDeleteProtectedPath,Ru as isSiteEditSourceDirectoryPath,Ar as isSiteEditSourcePath,Mi as isSiteEditTextSourcePath,XE as isSitePublishQualityItemIssue,EU as isSitePublishRepairResultSuccessful,eM as isSiteStructureKnownFieldPath,JL as isSiteStructureLocalizableFieldPath,OA as isStep5RequiredStrategyKey,Ei as isTopLevelPage,uO as isUserStoppedRunErrorCode,lP as isWorkflowTaskTypeForNode,zM as isWorkspaceFileMutationToolName,hp as listChildPages,Of as makeSiteEditRepeatInstanceKey,KR as markAllPagesInHeader,NL as mergeCmsFormDisplay,Bv as migrationProductsCopyForLocale,Kv as migrationProductsKnownCopies,BR as moreLabelForLocale,ZR as navLabelCollisionKey,lL as normalizeCmsApplicationSlug,Gx as normalizeCmsPublicApiBase,xl as normalizeFormOptionLabelIdentity,ls as normalizeGscDomain,hr as normalizePageTemplatePagePath,xi as normalizeStructureTitle,HR as orderNavigationLinksByStructure,Sp as orderSitemapPagesForDisplay,B_ as pageSlugToRouteFilePath,r1 as parseCmsPageDirectory,jv as parseComponentI18nResourcesJson,UR as parseE2bPreviewProxyDomain,db as parseExactEditEngineVersion,sA as parseSiteEditCompositionKey,Nf as parseSiteEditRepeatInstanceKey,ow as parseSiteEditSourceIdentityKey,Ea as parseWorkspaceAttachmentImagePath,OL as projectFormSpecToCmsDisplay,DL as projectFormSpecToCmsSchema,XS as readColorScheme,zs as readDesignTokens,VC as readGlobalsDesignValues,Sm as readSiteDesignNotes,UP as readWorkspaceAttachmentReferences,FR as reconcileSitemapNavigation,pM as resolveCmsPublicRuntimeBinding,yS as resolveFont,mn as resolveFontDisplayName,vL as resolveFormTemplateText,cP as resolvePublishedWorkflowDefinition,D0 as resolveRedisConnectionConfig,yO as resolveRequestedEditEngineVersion,Dr as resolveSelectableSiteLocale,iO as resolveSiteEditRuntimeOperationSummary,EA as resolveSiteLocaleFromIso6393,xA as resolveSiteTextDirection,Sy as resolveStep6RadiusId,fy as resolveStep6WeightStyle,xO as resolveSystemCurrentEditEngineVersion,uL as resolveTemplateFormScene,LC as resolveTryOnFontWeights,gh as selectPublishedWorkflowDefinition,J0 as selectReferenceVisualImage,qw as siteBuildStatusFromCode,zw as siteBuildStatusToCode,Ww as siteDeploymentStatusFromCode,Hw as siteDeploymentStatusToCode,AS as siteFontVariables,jS as siteLeadingBody,jC as siteLeadingHeadingVariables,NC as siteWeightVariables,Bw as siteWorkflowStatusFromCode,$w as siteWorkflowStatusToCode,gb as splitSubsiteGlossaryEntry,by as step6GptVisualIdentity,GC as stripSiteDesignNotes,CD as stripSiteEditRepeatInstanceKeys,Kw as taskExecutionStatusFromCode,Vw as taskExecutionStatusToCode,kj as toStep6GenerationVisualHints,_c as tryCanonicalizeAsciiPageSlug,qC as upsertSiteDesignNotes,Pm as validateComponentI18nResources,AL as validateFormSpecIdentityTransition,VR as validateSitemapStructure,Tb as validateSubsiteDiffEstimates,Ow as validateWorkspaceResourcePageCopy,MP as workspaceAttachmentImagePath,$C as writeColorScheme,HC as writeDesignTokens};
|