refactor: tighten embedded prompt and sidecar guards

This commit is contained in:
Peter Steinberger
2026-03-23 22:08:22 -07:00
parent cd90130877
commit 2e1c88b728
14 changed files with 150 additions and 71 deletions

View File

@@ -0,0 +1,34 @@
export const BUNDLED_RUNTIME_SIDECAR_PATHS = [
"dist/extensions/whatsapp/light-runtime-api.js",
"dist/extensions/whatsapp/runtime-api.js",
"dist/extensions/matrix/helper-api.js",
"dist/extensions/matrix/runtime-api.js",
"dist/extensions/matrix/thread-bindings-runtime.js",
"dist/extensions/msteams/runtime-api.js",
] as const;
const EXTRA_GUARDED_EXTENSION_PUBLIC_SURFACE_BASENAMES = [
"action-runtime.runtime.js",
"action-runtime-api.js",
"allow-from.js",
"api.js",
"auth-presence.js",
"index.js",
"login-qr-api.js",
"onboard.js",
"openai-codex-catalog.js",
"provider-catalog.js",
"session-key-api.js",
"setup-api.js",
"setup-entry.js",
"timeouts.js",
] as const;
export const GUARDED_EXTENSION_PUBLIC_SURFACE_BASENAMES = [
...new Set([
...BUNDLED_RUNTIME_SIDECAR_PATHS.map(
(relativePath) => relativePath.split("/").at(-1) ?? relativePath,
),
...EXTRA_GUARDED_EXTENSION_PUBLIC_SURFACE_BASENAMES,
]),
] as const;