diff --git a/scripts/patch-ap-allow-private-address.mjs b/scripts/patch-ap-allow-private-address.mjs index 5cb57885..292ec58d 100644 --- a/scripts/patch-ap-allow-private-address.mjs +++ b/scripts/patch-ap-allow-private-address.mjs @@ -74,12 +74,12 @@ for (const filePath of candidates) { checked += 1; const source = await readFile(filePath, "utf8"); - if (source.includes(MARKER)) { + if (source.includes(MARKER) || source.includes("allowPrivateAddress")) { continue; } if (!source.includes(OLD_SNIPPET)) { - console.log(`[postinstall] patch-ap-allow-private-address: snippet not found in ${filePath}`); + console.log(`[postinstall] patch-ap-allow-private-address: snippet not found in ${filePath} — skipping`); continue; } diff --git a/scripts/patch-endpoint-posts-ai-cleanup.mjs b/scripts/patch-endpoint-posts-ai-cleanup.mjs index 86acf520..3114f6c8 100644 --- a/scripts/patch-endpoint-posts-ai-cleanup.mjs +++ b/scripts/patch-endpoint-posts-ai-cleanup.mjs @@ -90,8 +90,12 @@ for (const filePath of candidates) { } if (!source.includes(oldSnippet)) { - // Beta.41+ has native AI field cleanup — skip silently - if (source.includes('"ai-text-level"') && source.includes('"ai-code-level"')) { + // Already has AI field cleanup in some form — skip silently + if ( + source.includes('"ai-text-level"') || + source.includes('"aiTextLevel"') || + !source.includes("jf2ToMf2") + ) { continue; } console.warn(