Files
reverse-engineering-anything/src/cli/domainInput.ts
T
morlutoandCursor Agent b31fc5d5fb fix(cli): advertise domain constraints for selector and path options (#9181)
* fix(cli): advertise domain constraints for selector and path options

Android class, method, and mapping fields, ADB setting keys, and browser
endpoints used bare strings in --schema. They now reuse the domain fields,
so empty selectors, relative mapping paths, and malformed setting keys
fail in the advertised schema.

* fix(cli): keep selector limits when argument parsing rejects them

Empty browser and Electron selectors now fail in the CLI parser, so their
diagnostics are VALIDATION_ERROR with the one-character minimum. ADB
setting keys stay on the selector repair path, which restores maximum 256
and the identifier pattern.

* test(cli): assert empty-selector codes without frozen prose

Empty browser and Electron selectors still fail as VALIDATION_ERROR
too_small on the named field. The tests no longer copy Zod's sentence.

* test(cli): compare endpoint diagnostics with the domain schema

Browser and Inspector tests take custom issue text from the schema that
owns it, and empty capture comparison must name both missing inspection
fields.

* fix(cli): remove duplicate merged schema import

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-11-07 16:17:09 +08:00

10 lines
360 B
TypeScript

import { z } from "incur";
/**
* CLI argv keeps the domain field's inbound text. A service transform still
* runs when that service parses the same field, and `--schema` matches the
* input view advertised by tools/list.
*/
export const cliDomainInput = (field: z.ZodType): z.ZodType =>
field instanceof z.ZodPipe ? (field.def.in as z.ZodType) : field;