fix(cli): preserve ADB extra schema in the product catalog (#12060)

This commit is contained in:
morluto authored and GitHub committed 2026-11-18 09:11:32 -05:00
1 parent 80f533da8a
commit da7982e105
1 file changed
+11 -17
+11 -17
View File
@@ -178,23 +178,17 @@ export const activityExtraCliEntrySchema = z
activityExtraCliPattern("float", patternBody(javaFloatValuePattern)),
),
])
.transform((entry, context) => {
const typeEnd = entry.indexOf(":");
const keyEnd = entry.indexOf(":", typeEnd + 1);
const parsed = activityExtraSchema.safeParse({
type: entry.slice(0, typeEnd),
key: entry.slice(typeEnd + 1, keyEnd),
value: entry.slice(keyEnd + 1),
});
if (parsed.success) return parsed.data;
context.addIssue({
code: "custom",
message:
parsed.error.issues[0]?.message ??
"Extra does not match the activity extra contract",
});
return z.NEVER;
});
.pipe(
z.preprocess((entry: string) => {
const typeEnd = entry.indexOf(":");
const keyEnd = entry.indexOf(":", typeEnd + 1);
return {
type: entry.slice(0, typeEnd),
key: entry.slice(typeEnd + 1, keyEnd),
value: entry.slice(keyEnd + 1),
};
}, activityExtraSchema),
);
/**
* Caller intent for ADB-backed device inspection and acquisition.