{"version":3,"file":"constants-BgCEW975.mjs","names":[],"sources":["../src/lib/code-scanning/integrations/cocoaPods.ts","../src/lib/code-scanning/integrations/gradle.ts","../src/lib/code-scanning/integrations/javascriptPackageJson.ts","../src/lib/code-scanning/integrations/pythonRequirementsTxt.ts","../src/lib/code-scanning/integrations/gemfile.ts","../src/lib/code-scanning/integrations/pubspec.ts","../src/lib/code-scanning/integrations/composerJson.ts","../src/lib/code-scanning/integrations/swift.ts","../src/lib/code-scanning/integrations/kotlin.ts","../src/lib/code-scanning/constants.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\n\nimport { CodePackageType } from '@transcend-io/privacy-types';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\n\nimport { CodePackageSdk } from '../../../codecs.js';\nimport { CodeScanningConfig } from '../types.js';\n\nconst POD_TARGET_REGEX = /target ('|\")(.*?)('|\")/;\nconst POD_PACKAGE_REGEX = /pod ('|\")(.*?)('|\")(, ('|\")~> (.+?)('|\")|)/;\n\nexport const cocoaPods: CodeScanningConfig = {\n  supportedFiles: ['Podfile'],\n  ignoreDirs: ['Pods', 'Build'],\n  scanFunction: (filePath) => {\n    const fileContents = readFileSync(filePath, 'utf-8');\n\n    const targets = findAllWithRegex(\n      {\n        value: new RegExp(POD_TARGET_REGEX, 'g'),\n        matches: ['quote1', 'name', 'quote2'],\n      },\n      fileContents,\n    );\n    const packages = findAllWithRegex(\n      {\n        value: new RegExp(POD_PACKAGE_REGEX, 'g'),\n        matches: ['quote1', 'name', 'quote2', 'extra', 'quote3', 'version', 'quote4'],\n      },\n      fileContents,\n    );\n\n    const deps: CodePackageSdk[] = targets.map((target, ind) => ({\n      name: target.name,\n      type: CodePackageType.CocoaPods,\n      softwareDevelopmentKits: packages\n        .filter(\n          (pkg) =>\n            pkg.matchIndex > target.matchIndex &&\n            (!targets[ind + 1] || pkg.matchIndex < targets[ind + 1].matchIndex),\n        )\n        .map((pkg) => ({\n          name: pkg.name,\n          version: pkg.version,\n        })),\n    }));\n\n    return deps;\n  },\n};\n","import { readFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\n\nimport { findAllWithRegex } from '@transcend-io/type-utils';\n\nimport { CodeScanningConfig } from '../types.js';\n\nconst GRADLE_IMPLEMENTATION_REGEX = /implementation( *)('|\")(.+?):(.+?):(.+?|)('|\")/;\nconst GRADLE_PLUGIN_REGEX = /apply plugin: *('|\")(.+?)(:(.+?)|)('|\")/;\nconst GRADLE_IMPLEMENTATION_GROUP_REGEX =\n  /implementation group:( *)('|\")(.+?)('|\"),( *)name:( *)('|\")(.+?)('|\"),( *)version:( *)('|\")(.+?)('|\")/;\nconst GRADLE_APPLICATION_NAME_REGEX = /applicationId( *)\"(.+?)\"/;\n\n/**\n * So far, there are three ways of defining dependencies that is supported\n * implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.core', version: '3.28.0'\n * or\n * implementation 'com.google.firebase:firebase-analytics:18.0.0'\n * or\n * apply plugin: 'com.google.gms.google-services'\n *\n * single and double quotes are both recognized\n */\nexport const gradle: CodeScanningConfig = {\n  supportedFiles: ['build.gradle**'],\n  ignoreDirs: ['gradle-app.setting', 'gradle-wrapper.jar', 'gradle-wrapper.properties'],\n  scanFunction: (filePath) => {\n    const fileContents = readFileSync(filePath, 'utf-8');\n    const directory = dirname(filePath);\n\n    const targets = findAllWithRegex(\n      {\n        value: new RegExp(GRADLE_IMPLEMENTATION_REGEX, 'g'),\n        matches: ['space', 'quote1', 'name', 'path', 'version', 'quote2'],\n      },\n      fileContents,\n    );\n    const targetPlugins = findAllWithRegex(\n      {\n        value: new RegExp(GRADLE_PLUGIN_REGEX, 'g'),\n        matches: ['quote1', 'name', 'group', 'version', 'quote2'],\n      },\n      fileContents,\n    );\n    const targetGroups = findAllWithRegex(\n      {\n        value: new RegExp(GRADLE_IMPLEMENTATION_GROUP_REGEX, 'g'),\n        matches: [\n          'space1',\n          'quote1',\n          'group',\n          'quote2',\n          'space2',\n          'space3',\n          'quote3',\n          'name',\n          'quote4',\n          'space4',\n          'space5',\n          'quote5',\n          'version',\n          'quote6',\n        ],\n      },\n      fileContents,\n    );\n    const applications = findAllWithRegex(\n      {\n        value: new RegExp(GRADLE_APPLICATION_NAME_REGEX, 'g'),\n        matches: ['space', 'name'],\n      },\n      fileContents,\n    );\n    if (applications.length > 1) {\n      throw new Error(`Expected only one applicationId per file: ${filePath}`);\n    }\n\n    return [\n      {\n        name: applications[0]?.name || directory.split('/').pop()!,\n        softwareDevelopmentKits: [...targets, ...targetGroups, ...targetPlugins].map((target) => ({\n          name: target.name,\n          version: target.version || undefined,\n        })),\n      },\n    ];\n  },\n};\n","import { readFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\n\nimport { CodePackageSdk } from '../../../codecs.js';\nimport { CodeScanningConfig } from '../types.js';\n\nexport const javascriptPackageJson: CodeScanningConfig = {\n  supportedFiles: ['package.json'],\n  ignoreDirs: ['node_modules', 'serverless-build', 'lambda-build'],\n  scanFunction: (filePath) => {\n    const file = readFileSync(filePath, 'utf-8');\n    const directory = dirname(filePath);\n    const asJson = JSON.parse(file);\n    const {\n      name,\n      description,\n      dependencies = {},\n      devDependencies = {},\n      optionalDependencies = {},\n    } = asJson;\n    return [\n      {\n        // name of the package\n        name: name || directory.split('/').pop()!,\n        description,\n        softwareDevelopmentKits: [\n          ...Object.entries(dependencies).map(\n            ([name, version]): CodePackageSdk => ({\n              name,\n              version: typeof version === 'string' ? version : undefined,\n            }),\n          ),\n          ...Object.entries(devDependencies).map(\n            ([name, version]): CodePackageSdk => ({\n              name,\n              version: typeof version === 'string' ? version : undefined,\n              isDevDependency: true,\n            }),\n          ),\n          ...Object.entries(optionalDependencies).map(\n            ([name, version]): CodePackageSdk => ({\n              name,\n              version: typeof version === 'string' ? version : undefined,\n            }),\n          ),\n        ],\n      },\n    ];\n  },\n};\n","import { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\n\nimport { CodePackageType } from '@transcend-io/privacy-types';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\n\nimport { listFiles } from '../../api-keys/index.js';\nimport { CodeScanningConfig } from '../types.js';\n\nconst REQUIREMENTS_PACKAGE_MATCH = /(.+?)(=+)(.+)/;\nconst PACKAGE_NAME = /name *= *('|\")(.+?)('|\")/;\nconst PACKAGE_DESCRIPTION = /description *= *('|\")(.+?)('|\")/;\n\nexport const pythonRequirementsTxt: CodeScanningConfig = {\n  supportedFiles: ['requirements.txt'],\n  ignoreDirs: ['build', 'lib', 'lib64'],\n  scanFunction: (filePath) => {\n    const fileContents = readFileSync(filePath, 'utf-8');\n    const directory = dirname(filePath);\n    const filesInFolder = listFiles(directory);\n\n    // parse setup file for name\n    const setupFile = filesInFolder.find((file) => file === 'setup.py');\n    const setupFileContents = setupFile\n      ? readFileSync(join(directory, setupFile), 'utf-8')\n      : undefined;\n    const packageName = setupFileContents\n      ? (PACKAGE_NAME.exec(setupFileContents) || [])[2]\n      : undefined;\n    const packageDescription = setupFileContents\n      ? (PACKAGE_DESCRIPTION.exec(setupFileContents) || [])[2]\n      : undefined;\n\n    const targets = findAllWithRegex(\n      {\n        value: new RegExp(REQUIREMENTS_PACKAGE_MATCH, 'g'),\n        matches: ['name', 'equals', 'version'],\n      },\n      fileContents,\n    );\n\n    return [\n      {\n        name: packageName || directory.split('/').pop()!,\n        description: packageDescription || undefined,\n        type: CodePackageType.RequirementsTxt,\n        softwareDevelopmentKits: targets.map((pkg) => ({\n          name: pkg.name,\n          version: pkg.version,\n        })),\n      },\n    ];\n  },\n};\n","import { readFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\n\nimport { CodePackageType } from '@transcend-io/privacy-types';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\n\nimport { listFiles } from '../../api-keys/index.js';\nimport { CodeScanningConfig } from '../types.js';\n\nconst GEM_PACKAGE_REGEX = /gem *('|\")(.+?)('|\")(, *('|\")(.+?)('|\")|)/;\nconst GEMFILE_PACKAGE_NAME_REGEX = /spec\\.name *= *('|\")(.+?)('|\")/;\nconst GEMFILE_PACKAGE_DESCRIPTION_REGEX = /spec\\.description *= *('|\")(.+?)('|\")/;\nconst GEMFILE_PACKAGE_SUMMARY_REGEX = /spec\\.summary *= *('|\")(.+?)('|\")/;\n\nexport const gemfile: CodeScanningConfig = {\n  supportedFiles: ['Gemfile'],\n  ignoreDirs: ['bin'],\n  scanFunction: (filePath) => {\n    const fileContents = readFileSync(filePath, 'utf-8');\n    const directory = dirname(filePath);\n    const filesInFolder = listFiles(directory);\n\n    // parse gemspec file for name\n    const gemspec = filesInFolder.find((file) => file === '.gemspec');\n    const gemspecContents = gemspec ? readFileSync(gemspec, 'utf-8') : undefined;\n    const gemfileName = gemspecContents\n      ? (GEMFILE_PACKAGE_NAME_REGEX.exec(gemspecContents) || [])[2]\n      : undefined;\n    const gemfileDescription = gemspecContents\n      ? (GEMFILE_PACKAGE_DESCRIPTION_REGEX.exec(gemspecContents) ||\n          GEMFILE_PACKAGE_SUMMARY_REGEX.exec(gemspecContents) ||\n          [])[1]\n      : undefined;\n\n    const targets = findAllWithRegex(\n      {\n        value: new RegExp(GEM_PACKAGE_REGEX, 'g'),\n        matches: ['quote1', 'name', 'quote2', 'hasVersion', 'quote3', 'version', 'quote4'],\n      },\n      fileContents,\n    );\n\n    return [\n      {\n        name: gemfileName || directory.split('/').pop()!,\n        description: gemfileDescription || undefined,\n        type: CodePackageType.RequirementsTxt,\n        softwareDevelopmentKits: targets.map((pkg) => ({\n          name: pkg.name,\n          version: pkg.version,\n        })),\n      },\n    ];\n  },\n};\n","import { readFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\n\nimport { CodePackageType } from '@transcend-io/privacy-types';\nimport yaml from 'js-yaml';\n\nimport { CodeScanningConfig } from '../types.js';\n\n/**\n * Remove YAML comments from a string\n *\n * @param yamlString - YAML string\n * @returns String without comments\n */\nfunction removeYAMLComments(yamlString: string): string {\n  return yamlString\n    .split('\\n')\n    .map((line) => {\n      // Remove inline comments\n      const commentIndex = line.indexOf('#');\n      if (commentIndex > -1) {\n        // Check if '#' is not inside a string\n        if (\n          !line.substring(0, commentIndex).includes('\"') &&\n          !line.substring(0, commentIndex).includes(\"'\")\n        ) {\n          return line.substring(0, commentIndex).trim();\n        }\n      }\n      return line;\n    })\n    .filter((line) => line.length > 0)\n    .join('\\n');\n}\n\nexport const pubspec: CodeScanningConfig = {\n  supportedFiles: ['pubspec.yml'],\n  ignoreDirs: ['build'],\n  scanFunction: (filePath) => {\n    const directory = dirname(filePath);\n    const fileContents = readFileSync(filePath, 'utf-8');\n    const {\n      name,\n      description,\n      dev_dependencies = {},\n      dependencies = {},\n    } = yaml.load(removeYAMLComments(fileContents)) as {\n      /** Name */\n      name?: string;\n      /** Description */\n      description?: string;\n      /** Dev dependencies */\n      dev_dependencies?: { [k in string]: number | Record<string, string> };\n      /** Dependencies */\n      dependencies?: { [k in string]: number | Record<string, string> };\n    };\n    return [\n      {\n        name: name || directory.split('/').pop()!,\n        description,\n        type: CodePackageType.RequirementsTxt,\n        softwareDevelopmentKits: [\n          ...Object.entries(dependencies).map(([name, version]) => ({\n            name,\n            version:\n              typeof version === 'string'\n                ? version\n                : typeof version === 'number'\n                  ? version.toString()\n                  : version?.sdk,\n          })),\n          ...Object.entries(dev_dependencies).map(([name, version]) => ({\n            name,\n            version:\n              typeof version === 'string'\n                ? version\n                : typeof version === 'number'\n                  ? version.toString()\n                  : version?.sdk,\n            isDevDependency: true,\n          })),\n        ],\n      },\n    ];\n  },\n};\n","import { readFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\n\nimport { CodePackageSdk } from '../../../codecs.js';\nimport { CodeScanningConfig } from '../types.js';\n\nexport const composerJson: CodeScanningConfig = {\n  supportedFiles: ['composer.json'],\n  ignoreDirs: ['vendor', 'node_modules', 'cache', 'build', 'dist'],\n  scanFunction: (filePath) => {\n    const file = readFileSync(filePath, 'utf-8');\n    const directory = dirname(filePath);\n    const asJson = JSON.parse(file);\n    const {\n      name,\n      description,\n      require: requireDependencies = {},\n      'require-dev': requiredDevDependencies = {},\n    } = asJson;\n    return [\n      {\n        // name of the package\n        name: name || directory.split('/').pop()!,\n        description,\n        softwareDevelopmentKits: [\n          ...Object.entries(requireDependencies).map(\n            ([name, version]): CodePackageSdk => ({\n              name,\n              version: typeof version === 'string' ? version : undefined,\n            }),\n          ),\n          ...Object.entries(requiredDevDependencies).map(\n            ([name, version]): CodePackageSdk => ({\n              name,\n              version: typeof version === 'string' ? version : undefined,\n              isDevDependency: true,\n            }),\n          ),\n        ],\n      },\n    ];\n  },\n};\n","import { readFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\n\nimport { CodePackageType } from '@transcend-io/privacy-types';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport * as t from 'io-ts';\n\nimport { CodeScanningConfig } from '../types.js';\n\nconst SwiftPackage = t.type({\n  pins: t.array(\n    t.type({\n      identity: t.string,\n      kind: t.string,\n      location: t.string,\n      state: t.intersection([\n        t.type({\n          revision: t.string,\n        }),\n        t.partial({\n          version: t.union([t.string, t.undefined, t.null]),\n        }),\n      ]),\n    }),\n  ),\n  version: t.number,\n});\n\nconst SwiftPackageV1 = t.type({\n  object: t.type({\n    pins: t.array(\n      t.type({\n        package: t.string,\n        repositoryURL: t.string,\n        state: t.intersection([\n          t.type({\n            branch: t.union([t.string, t.undefined, t.null]),\n            revision: t.string,\n          }),\n          t.partial({\n            version: t.union([t.string, t.undefined, t.null]),\n          }),\n        ]),\n      }),\n    ),\n  }),\n  version: t.number,\n});\n\nexport const swift: CodeScanningConfig = {\n  supportedFiles: ['Package.resolved'],\n  ignoreDirs: [],\n  scanFunction: (filePath) => {\n    const fileContents = readFileSync(filePath, 'utf-8');\n\n    // Attempt latest version first\n    try {\n      const parsed = decodeCodec(SwiftPackage, fileContents);\n      const splitPath = dirname(filePath).split('/');\n      const originalName = splitPath[splitPath.length - 1];\n      let name = originalName;\n      if (name === 'swiftpm') {\n        name = splitPath[splitPath.length - 2];\n        if (name === 'xcshareddata') {\n          name = splitPath[splitPath.length - 3];\n        } else if (!name) {\n          name = originalName;\n        }\n        if (name === 'project.xcworkspace') {\n          name = splitPath[splitPath.length - 4];\n        }\n      }\n      return [\n        {\n          name,\n          type: CodePackageType.Swift,\n          softwareDevelopmentKits: parsed.pins.map((target) => ({\n            name: target.identity,\n            version: target.state.version || undefined,\n          })),\n        },\n      ];\n    } catch (e) {\n      // Throw non codec errors\n      if (!e?.message?.includes('Failed to decode codec')) {\n        throw e;\n      }\n\n      // Attempt v1\n      try {\n        const parsed = decodeCodec(SwiftPackageV1, fileContents);\n        return [\n          {\n            name: dirname(filePath).split('/').pop() || '', // TODO pull from Package.swift ->> name if possible\n            type: CodePackageType.Swift,\n            softwareDevelopmentKits: parsed.object.pins.map((target) => ({\n              name: target.package,\n              version: target.state.version || undefined,\n            })),\n          },\n        ];\n      } catch (e2) {\n        if (!e2?.message?.includes('Failed to decode codec')) {\n          throw e2;\n        }\n        throw e;\n      }\n    }\n  },\n};\n","import { readFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\n\nimport { findAllWithRegex } from '@transcend-io/type-utils';\n\nimport { CodeScanningConfig } from '../types.js';\n\n/**\n * Kotlin DSL (build.gradle.kts) dependency & plugin parsing\n */\n\nconst KTS_DEP_CONFIGS =\n  // eslint-disable-next-line max-len\n  '(implementation|api|kapt|ksp|debugImplementation|releaseImplementation|androidTestImplementation|testImplementation|compileOnly|runtimeOnly)';\n\n// e.g. implementation(\"com.google.firebase:firebase-analytics:18.0.0\")\nconst KTS_DEP_STRING_COORDS_REGEX = new RegExp(\n  `${KTS_DEP_CONFIGS}\\\\s*\\\\(\\\\s*[\"']([^\"':\\\\s]+):([^\"':\\\\s]+):?([^\"']*)[\"']\\\\s*\\\\)`,\n  'g',\n);\n// captures: [1]=config, [2]=group, [3]=artifact, [4]=version (may be '')\n\n// e.g. implementation(platform(\"com.google.firebase:firebase-bom:33.1.2\"))\nconst KTS_DEP_PLATFORM_REGEX = new RegExp(\n  `${KTS_DEP_CONFIGS}\\\\s*\\\\(\\\\s*platform\\\\(\\\\s*[\"']([^\"':\\\\s]+):([^\"':\\\\s]+):?([^\"']*)[\"']\\\\s*\\\\)\\\\s*\\\\)`,\n  'g',\n);\n\n// e.g. implementation(libs.androidx.appcompat) / implementation(libs[\"androidx-core-ktx\"])\nconst KTS_DEP_LIBS_ALIAS_REGEX = new RegExp(\n  `${KTS_DEP_CONFIGS}\\\\s*\\\\(\\\\s*libs(?:\\\\.[\\\\w\\\\-\\\\.]+|\\\\[[\"'][^\"']+[\"']\\\\])\\\\s*\\\\)`,\n  'g',\n);\n\n// Plugins:\n//   plugins { id(\"com.google.gms.google-services\") version \"4.4.2\" apply false }\n//   plugins { id(\"org.jetbrains.kotlin.android\") }\n//   apply(plugin = \"newrelic\")\n//   plugins { alias(libs.plugins.kotlin.android) }\nconst KTS_PLUGIN_ID_REGEX = /id\\s*\\(\\s*[\"']([^\"']+)[\"']\\s*\\)(?:\\s*version\\s*[\"']([^\"']+)[\"'])?/g;\nconst KTS_PLUGIN_APPLY_REGEX = /apply\\s*\\(\\s*plugin\\s*=\\s*[\"']([^\"']+)[\"']\\s*\\)/g;\nconst KTS_PLUGIN_ALIAS_REGEX =\n  /plugins\\s*\\{[^}]*alias\\s*\\(\\s*libs(?:\\.plugins)?(?:\\.[\\w\\-.]+|\\[[\"'][^\"']+[\"']\\])\\s*\\)[^}]*\\}/g;\n\n// applicationId in Kotlin DSL:\n//   applicationId = \"com.foo.bar\"\n//   applicationId(\"com.foo.bar\")\nconst KTS_APPLICATION_ID_EQ_REGEX = /applicationId\\s*=\\s*[\"']([^\"']+)[\"']/g;\nconst KTS_APPLICATION_ID_CALL_REGEX = /applicationId\\s*\\(\\s*[\"']([^\"']+)[\"']\\s*\\)/g;\n\n/**\n * Input dep entry (partial)\n */\ntype DepInput = {\n  /** Name of the dependency */\n  name: string;\n  /** Version of the dependency */\n  version?: string;\n};\n\n/**\n * Helper to normalize a parsed dep entry\n *\n * @param name - name\n * @param version - version\n * @returns normalized entry\n */\nfunction depEntry(name: string, version?: string): DepInput {\n  const v = version && version.trim().length > 0 && version !== '_' ? version.trim() : undefined;\n  return { name, version: v };\n}\n\nexport const kotlin: CodeScanningConfig = {\n  supportedFiles: ['**/build.gradle.kts', '**/*.gradle.kts'],\n  ignoreDirs: ['gradle-app.setting', 'gradle-wrapper.jar', 'gradle-wrapper.properties'],\n  scanFunction: (filePath) => {\n    const fileContents = readFileSync(filePath, 'utf-8');\n    const directory = dirname(filePath);\n\n    // ---------- applicationId ----------\n    const appIds = [\n      ...findAllWithRegex({ value: KTS_APPLICATION_ID_EQ_REGEX, matches: ['name'] }, fileContents),\n      ...findAllWithRegex(\n        { value: KTS_APPLICATION_ID_CALL_REGEX, matches: ['name'] },\n        fileContents,\n      ),\n    ];\n    if (appIds.length > 1) {\n      throw new Error(`Expected only one applicationId per file: ${filePath}`);\n    }\n    const appName = appIds[0]?.name || directory.split('/').pop()!;\n\n    // ---------- dependencies ----------\n    const deps: Array<DepInput> = [];\n\n    // \"group:artifact:version\"\n    for (const m of fileContents.matchAll(KTS_DEP_STRING_COORDS_REGEX)) {\n      const [, , group, artifact, version] = m;\n      deps.push(depEntry(`${group}:${artifact}`, version));\n    }\n\n    // platform(\"group:artifact:version\")\n    for (const m of fileContents.matchAll(KTS_DEP_PLATFORM_REGEX)) {\n      const [, , group, artifact, version] = m;\n      // Record as regular coord (you may prefer to tag as BoM separately)\n      deps.push(depEntry(`${group}:${artifact}`, version));\n    }\n\n    // libs aliases (version catalogs) — keep alias as name, unknown version\n    for (const m of fileContents.matchAll(KTS_DEP_LIBS_ALIAS_REGEX)) {\n      // Grab the exact token as name (best-effort)\n      const token = m[0]\n        .replace(/^[^(]+\\(\\s*/, '')\n        .replace(/\\)\\s*$/, '')\n        .trim(); // e.g., libs.androidx.appcompat or libs[\"androidx-core-ktx\"]\n      deps.push(depEntry(token));\n    }\n\n    // ---------- plugins ----------\n    const plugins: Array<DepInput> = [];\n\n    for (const m of fileContents.matchAll(KTS_PLUGIN_ID_REGEX)) {\n      const [, pid, pver] = m;\n      plugins.push(depEntry(pid, pver));\n    }\n\n    for (const m of fileContents.matchAll(KTS_PLUGIN_APPLY_REGEX)) {\n      const [, pid] = m;\n      plugins.push(depEntry(pid));\n    }\n\n    // alias(libs.plugins...) — keep alias token (no version)\n    if (KTS_PLUGIN_ALIAS_REGEX.test(fileContents)) {\n      // Collect all alias lines to preserve identifiers; light parse:\n      const aliasMatches = fileContents.matchAll(\n        /alias\\s*\\(\\s*(libs(?:\\.plugins)?(?:\\.[\\w\\-.]+|\\[[\"'][^\"']+[\"']\\]))\\s*\\)/g,\n      );\n      for (const m of aliasMatches) {\n        plugins.push(depEntry(m[1]));\n      }\n    }\n\n    // ---------- compose final list ----------\n    // Merge deps + plugins as \"softwareDevelopmentKits\"\n    const softwareDevelopmentKits = [...deps, ...plugins]\n      // de-dup by name+version\n      .reduce(\n        (acc, cur) => {\n          const key = `${cur.name}@@${cur.version || ''}`;\n          if (!acc.map.has(key)) {\n            acc.map.set(key, cur);\n            acc.list.push(cur);\n          }\n          return acc;\n        },\n        {\n          map: new Map<string, DepInput>(),\n          list: [] as Array<DepInput>,\n        },\n      ).list;\n\n    return [\n      {\n        name: appName,\n        softwareDevelopmentKits,\n      },\n    ];\n  },\n};\n","import { CodePackageType } from '@transcend-io/privacy-types';\n\nimport {\n  cocoaPods,\n  gradle,\n  javascriptPackageJson,\n  gemfile,\n  composerJson,\n  pubspec,\n  swift,\n  kotlin,\n  pythonRequirementsTxt,\n} from './integrations/index.js';\nimport { CodeScanningConfig } from './types.js';\n\n/**\n * @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead\n */\nexport const SILO_DISCOVERY_CONFIGS: {\n  [k in string]: CodeScanningConfig;\n} = {\n  cocoaPods,\n  gradle,\n  javascriptPackageJson,\n  pythonRequirementsTxt,\n  gemfile,\n  pubspec,\n  swift,\n};\n\nexport const CODE_SCANNING_CONFIGS: {\n  [k in CodePackageType]: CodeScanningConfig;\n} = {\n  [CodePackageType.CocoaPods]: cocoaPods,\n  [CodePackageType.Gradle]: gradle,\n  [CodePackageType.PackageJson]: javascriptPackageJson,\n  [CodePackageType.RequirementsTxt]: pythonRequirementsTxt,\n  [CodePackageType.Gemfile]: gemfile,\n  [CodePackageType.Pubspec]: pubspec,\n  [CodePackageType.ComposerJson]: composerJson,\n  [CodePackageType.Swift]: swift,\n  [CodePackageType.Kotlin]: kotlin,\n};\n"],"mappings":"4TAQA,MAAM,EAAmB,yBACnB,EAAoB,6CAEb,EAAgC,CAC3C,eAAgB,CAAC,UAAU,CAC3B,WAAY,CAAC,OAAQ,QAAQ,CAC7B,aAAe,GAAa,CAC1B,IAAM,EAAe,EAAa,EAAU,QAAQ,CAE9C,EAAU,EACd,CACE,MAAO,IAAI,OAAO,EAAkB,IAAI,CACxC,QAAS,CAAC,SAAU,OAAQ,SAAS,CACtC,CACD,EACD,CACK,EAAW,EACf,CACE,MAAO,IAAI,OAAO,EAAmB,IAAI,CACzC,QAAS,CAAC,SAAU,OAAQ,SAAU,QAAS,SAAU,UAAW,SAAS,CAC9E,CACD,EACD,CAiBD,OAf+B,EAAQ,KAAK,EAAQ,KAAS,CAC3D,KAAM,EAAO,KACb,KAAM,EAAgB,UACtB,wBAAyB,EACtB,OACE,GACC,EAAI,WAAa,EAAO,aACvB,CAAC,EAAQ,EAAM,IAAM,EAAI,WAAa,EAAQ,EAAM,GAAG,YAC3D,CACA,IAAK,IAAS,CACb,KAAM,EAAI,KACV,QAAS,EAAI,QACd,EAAE,CACN,EAEU,EAEd,CC1CK,EAA8B,iDAC9B,EAAsB,0CACtB,EACJ,wGACI,EAAgC,2BAYzB,EAA6B,CACxC,eAAgB,CAAC,iBAAiB,CAClC,WAAY,CAAC,qBAAsB,qBAAsB,4BAA4B,CACrF,aAAe,GAAa,CAC1B,IAAM,EAAe,EAAa,EAAU,QAAQ,CAC9C,EAAY,EAAQ,EAAS,CAE7B,EAAU,EACd,CACE,MAAO,IAAI,OAAO,EAA6B,IAAI,CACnD,QAAS,C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