{"record":{"id":"9e23dd99fb3b3cdb","repo":"ComposioHQ/composio","slug":"unsupported-betterswiftax-constant-fallback-con","errorCode":null,"errorMessage":"Unsupported BetterSwiftAX constant fallback: ${constantName}","messagePattern":"Unsupported BetterSwiftAX constant fallback: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/cli-local-tools/scripts/build-beeper-imessage-binaries.ts","lineNumber":59,"sourceCode":"const betterSwiftAxFallbackFiles = [\n  'Accessibility+Action.swift',\n  'Accessibility+AttributeKey.swift',\n  'Accessibility+Notification.swift',\n  'Accessibility+ParameterizedAttributeKey.swift',\n  'Accessibility+Role.swift',\n  'Accessibility+Subrole.swift',\n  'Accessibility+Value.swift',\n] as const;\n\nconst betterSwiftAxConstantReferencePattern =\n  /\\bkAX[A-Za-z0-9]+(?:Action|ParameterizedAttribute|Attribute|Notification|Subrole|Role|Value)\\b/g;\nconst betterSwiftAxConstantPattern =\n  /^kAX(.+?)(Action|ParameterizedAttribute|Attribute|Notification|Subrole|Role|Value)$/;\n\nconst betterSwiftAxConstantLiteral = (constantName: string): string => {\n  const match = betterSwiftAxConstantPattern.exec(constantName);\n  if (!match) {\n    throw new Error(`Unsupported BetterSwiftAX constant fallback: ${constantName}`);\n  }\n  return `\"AX${match[1]}\"`;\n};\n\nconst ensurePlatform = () => {\n  if (process.platform !== 'darwin') {\n    throw new Error(\n      'Building Beeper iMessage local-tool binaries requires macOS and the Swift toolchain.'\n    );\n  }\n};\n\nconst ensureSubmodule = async () => {\n  if (await exists(path.join(submodulePath, 'Package.swift'))) return;\n\n  console.log(`Initializing ${submoduleRelativePath} submodule...`);\n  await $`git submodule update --init --recursive -- ${submoduleRelativePath}`.cwd(repoRoot);\n","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli-local-tools/scripts/build-beeper-imessage-binaries.ts#L41-L77","documentation":"This build script patches the vendored BetterSwiftAX checkout by rewriting kAX* constants into string literals. When a constant name does not match the expected kAX...(Attribute|Action|Role|...) naming pattern, the script cannot derive the corresponding \"AX...\" string and aborts.","triggerScenarios":"Running the Beeper iMessage binary build script after BetterSwiftAX introduced a kAX-prefixed symbol whose suffix is not one of Action|ParameterizedAttribute|Attribute|Notification|Subrole|Role|Value (e.g. kAXError or a new constant type).","commonSituations":"A newer BetterSwiftAX version is resolved by `swift package resolve` after a submodule/lockfile update, adding constants the fallback patcher doesn't recognize.","solutions":["Pin/restore the BetterSwiftAX revision the script was written against (git submodule update / Package.resolved).","Extend betterSwiftAxConstantPattern and the literal mapping to cover the new constant suffix, mapping it to its correct \"AX...\" string.","If the new SDK exposes the constants natively, exclude those symbols from the fallback file patch list."],"exampleFix":"// before\nconst pattern = /^kAX(.+?)(Action|ParameterizedAttribute|Attribute|Notification|Subrole|Role|Value)$/;\n\n// after\nconst pattern = /^kAX(.+?)(Action|ParameterizedAttribute|Attribute|Notification|Subrole|Role|Value|Error)$/;","handlingStrategy":"validation","validationCode":"const ok = /^kAX(.+?)(Action|ParameterizedAttribute|Attribute|Notification|Subrole|Role|Value)$/.test(constantName);\nif (!ok) throw new Error(`unsupported constant: ${constantName}`);","typeGuard":"const isSupportedKaxConstant = (n: string): boolean =>\n  /^kAX(.+?)(Action|ParameterizedAttribute|Attribute|Notification|Subrole|Role|Value)$/.test(n);","tryCatchPattern":null,"preventionTips":["Pin BetterSwiftAX revisions via Package.resolved before running the build script.","Run the pattern check over all constants in the fallback files before patching to fail with context."],"tags":["build-script","swift","accessibility","regex-fallback"],"backgroundTag":"unsupported-symbol-in-codegen-patch","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}