Skip to content

Add replayable CDPMod refs#4

Closed
monadoid wants to merge 1 commit intomainfrom
sam/cdpmod-replayable-refs
Closed

Add replayable CDPMod refs#4
monadoid wants to merge 1 commit intomainfrom
sam/cdpmod-replayable-refs

Conversation

@monadoid
Copy link
Copy Markdown
Collaborator

@monadoid monadoid commented May 4, 2026

Summary

So this makes it so that we:

  1. Have built in commands like:

Mod.Page.open
Mod.Page.bind
Mod.Page.waitFor
Mod.Page.goto
Mod.Page.reload
Mod.Page.goBack
Mod.Page.goForward
Mod.Page.waitForLoadState
Mod.Page.waitForTimeout
Mod.Page.screenshot
Mod.Page.evaluate
Mod.Page.waitForSelector

  1. All of our built in commands only use the new replay-native handles:
export const ModPageSchema = z
  .object({
    object: z.literal("mod.page"),
    id: ModIdSchema,
  })
  .strict();

export const ModElementSchema = z
  .object({
    object: z.literal("mod.element"),
    id: ModIdSchema.optional(),
    page: ModPageSchema,
    frames: z.array(ModFrameHopSchema).default([]),
    selector: ModSelectorSchema,
    fingerprint: z
      .object({
        nodeName: z.string().optional(),
        text: z.string().optional(),
      })
      .strict()
      .optional(),
  })
  .strict();
  

Validation

  • pre-commit hooks passed: oxfmt, oxlint, tsc, build, test
  • pnpm test passed: 40/40 tests
  • pnpm run typecheck passed

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 19 files

@monadoid monadoid closed this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant