Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/runtime-core/src/command-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1301,10 +1301,14 @@ export const commandRegistry = [
{ name: "url", description: "Explicit editor path or absolute URL to open instead of resolving a target.", format: "path or URL" },
{ name: "wait-selector", description: "Optional visible selector assertion evaluated after semantic editor readiness.", format: "CSS selector" },
{ name: "wait-timeout", description: "Timeout for navigation and editor-ready waits.", format: "duration, e.g. 15s or 500ms" },
{ name: "presentation-url", description: "Optional frontend URL corresponding to the edited content. Enables bounded frontend-to-editor presentation evidence.", format: "path or URL" },
{ name: "presentation-frontend-selector", description: "Optional frontend content selector for presentation evidence; defaults to body and is bounded to 512 characters.", format: "CSS selector" },
{ name: "presentation-editor-selector", description: "Optional editor canvas selector for presentation evidence; defaults to the block list layout and is bounded to 512 characters.", format: "CSS selector" },
{ name: "presentation-threshold", description: "Maximum geometry delta ratio accepted by presentation evidence; defaults to 0.02.", format: "number between 0 and 1" },
{ name: "capture", description: "Comma-separated artifacts to capture after opening the editor.", format: "steps,console,errors,html,screenshot,editor-state,editor-validity" },
{ name: "artifact-prefix", description: "Optional artifact directory relative to the runtime artifact root for this invocation; defaults to files/browser. Use files/browser/editor-open/<name> to isolate per-fixture editor-open evidence in a batch.", format: "relative artifact directory" },
],
outputShape: "JSON summary with additive editorPresentation iframe stylesheet URLs and generated-presentation identities, plus files/browser/editor-steps.jsonl, editor-summary.json, editor-state.json, optional editor-validity.json, and optional console/errors/html/screenshot artifacts. When artifact-prefix is supplied, every editor-open artifact is written under that directory instead of files/browser.",
outputShape: "JSON summary with additive editorPresentation identities, expected settings identities, idle-canvas evidence, and optional frontend/editor/diff presentation-match screenshots when presentation-url is supplied, plus files/browser/editor-steps.jsonl, editor-summary.json, editor-state.json, optional editor-validity.json, and optional console/errors/html/screenshot artifacts. When artifact-prefix is supplied, every editor-open artifact is written under that directory instead of files/browser.",
policyRequirement: "Runtime policy commands must include wordpress.editor-open.",
recipe: true,
handler: { kind: "playground", method: "runEditorOpen" },
Expand Down
54 changes: 54 additions & 0 deletions packages/runtime-playground/src/browser-artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,56 @@ export interface BrowserEditorReadinessSummary {
postType?: string
}

export interface BrowserEditorIdleCanvasSummary {
schema: "wp-codebox/editor-idle-canvas/v1"
status: "captured" | "unavailable"
onboardingModalCount?: number
onboardingModals?: Array<{
selectors: string[]
tag: string
className: string
role?: string
ariaLabel?: string
text: string
controls: Array<{ tag: string; className: string; ariaLabel?: string; text: string; disabled: boolean }>
}>
preferences?: {
welcomeGuide?: boolean
welcomeGuideTemplate?: boolean
editPostWelcomeGuideActive?: boolean
}
}

export interface BrowserEditorPresentationMatchSummary {
schema: "wp-codebox/editor-presentation-match/v1"
status: "passed" | "failed" | "unavailable"
diagnostic?: string
equivalentCanvasWidths?: boolean
majorGeometryDrift?: boolean
unreadableContent?: boolean
hiddenContent?: boolean
unresolvedAssetCount?: number
frontendScreenshot?: string
editorScreenshot?: string
diffScreenshot?: string
geometry?: {
frontend: BrowserEditorPresentationSurfaceGeometry
liveEditor: BrowserEditorPresentationSurfaceGeometry
isolatedEditor: BrowserEditorPresentationSurfaceGeometry
}
}

export interface BrowserEditorPresentationSurfaceGeometry {
width: number
height: number
childCount: number
presentationResetPresent: boolean
marginRules: Array<{ selector: string; declaration: string; origin: string }>
style: { display: string; marginTop: string; marginBottom: string; maxWidth: string; minHeight: string; paddingTop: string; paddingBottom: string }
children: Array<{ tag: string; className: string; blockType?: string; top: number; width: number; height: number; marginTop: string; marginBottom: string; maxWidth: string; minHeight: string; paddingTop: string; paddingBottom: string }>
descendants: Array<{ path: string; tag: string; className: string; text: string; top: number; left: number; width: number; height: number; display: string; position: string; marginTop: string; marginBottom: string; maxWidth: string; minHeight: string; paddingTop: string; paddingBottom: string; gap: string; gridTemplateColumns: string; fontSize: string; lineHeight: string }>
}

export interface BrowserEditorPresentationSummary {
schema: "wp-codebox/editor-presentation/v1"
canvasDocumentType: "iframe" | "parent"
Expand All @@ -298,6 +348,10 @@ export interface BrowserEditorPresentationSummary {
iframeStylesheetUrls: string[]
generatedPresentationIdentityCount: number
generatedPresentationIdentities: string[]
expectedGeneratedPresentationIdentities?: string[]
expectedGeneratedPresentationIdentitiesComplete?: boolean
idleCanvas?: BrowserEditorIdleCanvasSummary
matchedRendering?: BrowserEditorPresentationMatchSummary
}

export interface BrowserEditorSaveSummary {
Expand Down
Loading
Loading