@base-attribution-os/github-action 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # Base Attribution OS GitHub Action
2
+
3
+ Scan pull requests for Base transaction paths that are missing the expected Builder Code attribution.
4
+
5
+ ```yaml
6
+ - uses: horn111/base-attribution-os/packages/github-action@v0.3.0
7
+ with:
8
+ builder-code: bc_example
9
+ profile: strict
10
+ ```
11
+
12
+ The action can scan changed files, apply a baseline, emit SARIF, and expose coverage metrics as outputs. Most users should consume the repository action shown above rather than install this package from npm.
13
+
14
+ [GitHub Action documentation](https://github.com/horn111/base-attribution-os/blob/main/docs/ci-validation.md) · [Issues](https://github.com/horn111/base-attribution-os/issues)
package/action.yml CHANGED
@@ -23,7 +23,6 @@ inputs:
23
23
  profile:
24
24
  description: "Scanner profile: local reports findings without failing by default, ci fails obvious missing attribution, strict requires the expected Builder Code in candidate files."
25
25
  required: false
26
- default: "ci"
27
26
  fail-on-missing:
28
27
  description: "Override the selected profile's default failure behavior."
29
28
  required: false
package/dist/index.cjs CHANGED
@@ -20536,7 +20536,7 @@ var require_typescript = __commonJS({
20536
20536
  isStatementWithLocals: () => isStatementWithLocals,
20537
20537
  isStatic: () => isStatic,
20538
20538
  isStaticModifier: () => isStaticModifier,
20539
- isString: () => isString,
20539
+ isString: () => isString2,
20540
20540
  isStringANonContextualKeyword: () => isStringANonContextualKeyword,
20541
20541
  isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection,
20542
20542
  isStringDoubleQuoted: () => isStringDoubleQuoted,
@@ -22158,7 +22158,7 @@ var require_typescript = __commonJS({
22158
22158
  function toArray(value) {
22159
22159
  return isArray(value) ? value : [value];
22160
22160
  }
22161
- function isString(text) {
22161
+ function isString2(text) {
22162
22162
  return typeof text === "string";
22163
22163
  }
22164
22164
  function isNumber(x) {
@@ -26635,7 +26635,7 @@ ${lanes.join("\n")}
26635
26635
  dirName,
26636
26636
  1,
26637
26637
  (eventName, relativeFileName) => {
26638
- if (!isString(relativeFileName)) return;
26638
+ if (!isString2(relativeFileName)) return;
26639
26639
  const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
26640
26640
  const filePath = toCanonicalName(fileName);
26641
26641
  const callbacks = fileName && fileWatcherCallbacks.get(filePath);
@@ -26824,7 +26824,7 @@ ${lanes.join("\n")}
26824
26824
  var _a, _b;
26825
26825
  let fileName;
26826
26826
  let invokeMap;
26827
- if (isString(fileNameOrInvokeMap)) {
26827
+ if (isString2(fileNameOrInvokeMap)) {
26828
26828
  fileName = fileNameOrInvokeMap;
26829
26829
  } else {
26830
26830
  invokeMap = fileNameOrInvokeMap;
@@ -36559,7 +36559,7 @@ ${lanes.join("\n")}
36559
36559
  return !isBigIntLiteral(node);
36560
36560
  }
36561
36561
  function getTextOfConstantValue(value) {
36562
- return isString(value) ? `"${escapeString(value)}"` : "" + value;
36562
+ return isString2(value) ? `"${escapeString(value)}"` : "" + value;
36563
36563
  }
36564
36564
  function makeIdentifierFromModuleName(moduleName) {
36565
36565
  return getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_");
@@ -40463,7 +40463,7 @@ ${lanes.join("\n")}
40463
40463
  return getStringFromExpandedCharCodes(expandedCharCodes);
40464
40464
  }
40465
40465
  function readJsonOrUndefined(path5, hostOrText) {
40466
- const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path5);
40466
+ const jsonText = isString2(hostOrText) ? hostOrText : hostOrText.readFile(path5);
40467
40467
  if (!jsonText) return void 0;
40468
40468
  let result = tryParseJson(jsonText);
40469
40469
  if (result === void 0) {
@@ -43072,7 +43072,7 @@ ${lanes.join("\n")}
43072
43072
  let associatedDeclarationForContainingInitializerOrBindingName;
43073
43073
  let withinDeferredContext = false;
43074
43074
  let grandparent;
43075
- const name = isString(nameArg) ? nameArg : nameArg.escapedText;
43075
+ const name = isString2(nameArg) ? nameArg : nameArg.escapedText;
43076
43076
  loop:
43077
43077
  while (location) {
43078
43078
  if (name === "const" && isConstAssertion(location)) {
@@ -64026,7 +64026,7 @@ ${lanes.join("\n")}
64026
64026
  );
64027
64027
  var commandLineOptionOfCustomType = optionDeclarations.filter(isCommandLineOptionOfCustomType);
64028
64028
  function isCommandLineOptionOfCustomType(option) {
64029
- return !isString(option.type);
64029
+ return !isString2(option.type);
64030
64030
  }
64031
64031
  var tscBuildOption = {
64032
64032
  name: "build",
@@ -64238,7 +64238,7 @@ ${lanes.join("\n")}
64238
64238
  }
64239
64239
  function parseResponseFile(fileName) {
64240
64240
  const text = tryReadFile(fileName, readFile || ((fileName2) => sys.readFile(fileName2)));
64241
- if (!isString(text)) {
64241
+ if (!isString2(text)) {
64242
64242
  errors.push(text);
64243
64243
  return;
64244
64244
  }
@@ -64397,11 +64397,11 @@ ${lanes.join("\n")}
64397
64397
  return { buildOptions, watchOptions, projects, errors };
64398
64398
  }
64399
64399
  function getDiagnosticText(message, ...args) {
64400
- return cast(createCompilerDiagnostic(message, ...args).messageText, isString);
64400
+ return cast(createCompilerDiagnostic(message, ...args).messageText, isString2);
64401
64401
  }
64402
64402
  function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend, extraFileExtensions) {
64403
64403
  const configFileText = tryReadFile(configFileName, (fileName) => host.readFile(fileName));
64404
- if (!isString(configFileText)) {
64404
+ if (!isString2(configFileText)) {
64405
64405
  host.onUnRecoverableConfigFileDiagnostic(configFileText);
64406
64406
  return void 0;
64407
64407
  }
@@ -64425,7 +64425,7 @@ ${lanes.join("\n")}
64425
64425
  }
64426
64426
  function readConfigFile(fileName, readFile) {
64427
64427
  const textOrDiagnostic = tryReadFile(fileName, readFile);
64428
- return isString(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic };
64428
+ return isString2(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic };
64429
64429
  }
64430
64430
  function parseConfigFileTextToJson(fileName, jsonText) {
64431
64431
  const jsonSourceFile = parseJsonText(fileName, jsonText);
@@ -64441,7 +64441,7 @@ ${lanes.join("\n")}
64441
64441
  }
64442
64442
  function readJsonConfigFile(fileName, readFile) {
64443
64443
  const textOrDiagnostic = tryReadFile(fileName, readFile);
64444
- return isString(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : { fileName, parseDiagnostics: [textOrDiagnostic] };
64444
+ return isString2(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : { fileName, parseDiagnostics: [textOrDiagnostic] };
64445
64445
  }
64446
64446
  function tryReadFile(fileName, readFile) {
64447
64447
  let text;
@@ -64694,7 +64694,7 @@ ${lanes.join("\n")}
64694
64694
  }
64695
64695
  }
64696
64696
  function getCompilerOptionValueTypeString(option) {
64697
- return option.type === "listOrElement" ? `${getCompilerOptionValueTypeString(option.element)} or Array` : option.type === "list" ? "Array" : isString(option.type) ? option.type : "string";
64697
+ return option.type === "listOrElement" ? `${getCompilerOptionValueTypeString(option.element)} or Array` : option.type === "list" ? "Array" : isString2(option.type) ? option.type : "string";
64698
64698
  }
64699
64699
  function isCompilerOptionsValue(option, value) {
64700
64700
  if (option) {
@@ -64705,7 +64705,7 @@ ${lanes.join("\n")}
64705
64705
  if (option.type === "listOrElement") {
64706
64706
  return isArray(value) || isCompilerOptionsValue(option.element, value);
64707
64707
  }
64708
- const expectedType = isString(option.type) ? option.type : "string";
64708
+ const expectedType = isString2(option.type) ? option.type : "string";
64709
64709
  return typeof value === expectedType;
64710
64710
  }
64711
64711
  return false;
@@ -65224,7 +65224,7 @@ ${lanes.join("\n")}
65224
65224
  basePathForFileNames
65225
65225
  ) || validatedExcludeSpecsBeforeSubstitution;
65226
65226
  }
65227
- const validatedFilesSpecBeforeSubstitution = filter(filesSpecs, isString);
65227
+ const validatedFilesSpecBeforeSubstitution = filter(filesSpecs, isString2);
65228
65228
  const validatedFilesSpec = getSubstitutedStringArrayWithConfigDirTemplate(
65229
65229
  validatedFilesSpecBeforeSubstitution,
65230
65230
  basePathForFileNames
@@ -65272,7 +65272,7 @@ ${lanes.join("\n")}
65272
65272
  return isArray(specResult) ? specResult : void 0;
65273
65273
  }
65274
65274
  function getSpecsFromRaw(prop) {
65275
- return getPropFromRaw(prop, isString, "string");
65275
+ return getPropFromRaw(prop, isString2, "string");
65276
65276
  }
65277
65277
  function getPropFromRaw(prop, validateElement, elementTypeName) {
65278
65278
  if (hasProperty(raw, prop) && !isNullOrUndefined(raw[prop])) {
@@ -65333,7 +65333,7 @@ ${lanes.join("\n")}
65333
65333
  }
65334
65334
  var configDirTemplate = `\${configDir}`;
65335
65335
  function startsWithConfigDirTemplate(value) {
65336
- return isString(value) && startsWith(
65336
+ return isString2(value) && startsWith(
65337
65337
  value,
65338
65338
  configDirTemplate,
65339
65339
  /*ignoreCase*/
@@ -65410,7 +65410,7 @@ ${lanes.join("\n")}
65410
65410
  if (ownConfig.extendedConfigPath) {
65411
65411
  resolutionStack = resolutionStack.concat([resolvedPath]);
65412
65412
  const result = { options: {} };
65413
- if (isString(ownConfig.extendedConfigPath)) {
65413
+ if (isString2(ownConfig.extendedConfigPath)) {
65414
65414
  applyExtendedConfig(result, ownConfig.extendedConfigPath);
65415
65415
  } else {
65416
65416
  ownConfig.extendedConfigPath.forEach((extendedConfigPath) => applyExtendedConfig(result, extendedConfigPath));
@@ -65468,7 +65468,7 @@ ${lanes.join("\n")}
65468
65468
  function getExtendsConfigPathOrArray(value, host, basePath, configFileName, errors, propertyAssignment, valueExpression, sourceFile) {
65469
65469
  let extendedConfigPath;
65470
65470
  const newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath;
65471
- if (isString(value)) {
65471
+ if (isString2(value)) {
65472
65472
  extendedConfigPath = getExtendsConfigPath(
65473
65473
  value,
65474
65474
  host,
@@ -65481,7 +65481,7 @@ ${lanes.join("\n")}
65481
65481
  extendedConfigPath = [];
65482
65482
  for (let index = 0; index < value.length; index++) {
65483
65483
  const fileName = value[index];
65484
- if (isString(fileName)) {
65484
+ if (isString2(fileName)) {
65485
65485
  extendedConfigPath = append(
65486
65486
  extendedConfigPath,
65487
65487
  getExtendsConfigPath(
@@ -65703,7 +65703,7 @@ ${lanes.join("\n")}
65703
65703
  return convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile);
65704
65704
  } else if (optType === "listOrElement") {
65705
65705
  return isArray(value) ? convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile) : convertJsonOption(opt.element, value, basePath, errors, propertyAssignment, valueExpression, sourceFile);
65706
- } else if (!isString(opt.type)) {
65706
+ } else if (!isString2(opt.type)) {
65707
65707
  return convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sourceFile);
65708
65708
  }
65709
65709
  const validatedValue = validateJsonOptionValue(opt, value, errors, valueExpression, sourceFile);
@@ -65844,7 +65844,7 @@ ${lanes.join("\n")}
65844
65844
  }
65845
65845
  function validateSpecs(specs, errors, disallowTrailingRecursion, jsonSourceFile, specKey) {
65846
65846
  return specs.filter((spec) => {
65847
- if (!isString(spec)) return false;
65847
+ if (!isString2(spec)) return false;
65848
65848
  const diag2 = specToDiagnostic(spec, disallowTrailingRecursion);
65849
65849
  if (diag2 !== void 0) {
65850
65850
  errors.push(createDiagnostic(...diag2));
@@ -68493,8 +68493,8 @@ ${lanes.join("\n")}
68493
68493
  function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, pathPatterns, loader, onlyRecordFailures, state) {
68494
68494
  const matchedPattern = matchPatternOrExact(pathPatterns, moduleName);
68495
68495
  if (matchedPattern) {
68496
- const matchedStar = isString(matchedPattern) ? void 0 : matchedText(matchedPattern, moduleName);
68497
- const matchedPatternText = isString(matchedPattern) ? matchedPattern : patternText(matchedPattern);
68496
+ const matchedStar = isString2(matchedPattern) ? void 0 : matchedText(matchedPattern, moduleName);
68497
+ const matchedPatternText = isString2(matchedPattern) ? matchedPattern : patternText(matchedPattern);
68498
68498
  if (state.traceEnabled) {
68499
68499
  trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
68500
68500
  }
@@ -70436,7 +70436,7 @@ ${lanes.join("\n")}
70436
70436
  110735
70437
70437
  /* ValueModuleExcludes */
70438
70438
  );
70439
- file.patternAmbientModules = append(file.patternAmbientModules, pattern && !isString(pattern) ? { pattern, symbol } : void 0);
70439
+ file.patternAmbientModules = append(file.patternAmbientModules, pattern && !isString2(pattern) ? { pattern, symbol } : void 0);
70440
70440
  }
70441
70441
  } else {
70442
70442
  const state = declareModuleSymbol(node);
@@ -73187,7 +73187,7 @@ ${lanes.join("\n")}
73187
73187
  }
73188
73188
  }
73189
73189
  const mainFileRelative = (packageJsonContent == null ? void 0 : packageJsonContent.typings) || (packageJsonContent == null ? void 0 : packageJsonContent.types) || (packageJsonContent == null ? void 0 : packageJsonContent.main) || "index.js";
73190
- if (isString(mainFileRelative) && !(maybeBlockedByTypesVersions && matchPatternOrExact(tryParsePatterns(versionPaths.paths), mainFileRelative))) {
73190
+ if (isString2(mainFileRelative) && !(maybeBlockedByTypesVersions && matchPatternOrExact(tryParsePatterns(versionPaths.paths), mainFileRelative))) {
73191
73191
  const mainExportFile = toPath(mainFileRelative, packageRootPath, getCanonicalFileName);
73192
73192
  const canonicalModuleFileToTry = getCanonicalFileName(moduleFileToTry);
73193
73193
  if (removeFileExtension(mainExportFile) === removeFileExtension(canonicalModuleFileToTry)) {
@@ -75271,7 +75271,7 @@ ${lanes.join("\n")}
75271
75271
  return false;
75272
75272
  }
75273
75273
  function onFailedToResolveSymbol(errorLocation, nameArg, meaning, nameNotFoundMessage) {
75274
- const name = isString(nameArg) ? nameArg : nameArg.escapedText;
75274
+ const name = isString2(nameArg) ? nameArg : nameArg.escapedText;
75275
75275
  addLazyDiagnostic(() => {
75276
75276
  if (!errorLocation || errorLocation.parent.kind !== 325 && !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) && !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
75277
75277
  let suggestion;
@@ -75389,7 +75389,7 @@ ${lanes.join("\n")}
75389
75389
  );
75390
75390
  }
75391
75391
  function diagnosticName(nameArg) {
75392
- return isString(nameArg) ? unescapeLeadingUnderscores(nameArg) : declarationNameToString(nameArg);
75392
+ return isString2(nameArg) ? unescapeLeadingUnderscores(nameArg) : declarationNameToString(nameArg);
75393
75393
  }
75394
75394
  function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) {
75395
75395
  if (!isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) {
@@ -104450,7 +104450,7 @@ ${lanes.join("\n")}
104450
104450
  );
104451
104451
  }
104452
104452
  function getSuggestedSymbolForNonexistentJSXAttribute(name, containingType) {
104453
- const strName = isString(name) ? name : idText(name);
104453
+ const strName = isString2(name) ? name : idText(name);
104454
104454
  const properties = getPropertiesOfType(containingType);
104455
104455
  const jsxSpecific = strName === "for" ? find(properties, (x) => symbolName(x) === "htmlFor") : strName === "class" ? find(properties, (x) => symbolName(x) === "className") : void 0;
104456
104456
  return jsxSpecific ?? getSpellingSuggestionForName(
@@ -122662,7 +122662,7 @@ ${lanes.join("\n")}
122662
122662
  return typeof x === "string" || x === null;
122663
122663
  }
122664
122664
  function isRawSourceMap(x) {
122665
- return x !== null && typeof x === "object" && x.version === 3 && typeof x.file === "string" && typeof x.mappings === "string" && isArray(x.sources) && every(x.sources, isString) && (x.sourceRoot === void 0 || x.sourceRoot === null || typeof x.sourceRoot === "string") && (x.sourcesContent === void 0 || x.sourcesContent === null || isArray(x.sourcesContent) && every(x.sourcesContent, isStringOrNull)) && (x.names === void 0 || x.names === null || isArray(x.names) && every(x.names, isString));
122665
+ return x !== null && typeof x === "object" && x.version === 3 && typeof x.file === "string" && typeof x.mappings === "string" && isArray(x.sources) && every(x.sources, isString2) && (x.sourceRoot === void 0 || x.sourceRoot === null || typeof x.sourceRoot === "string") && (x.sourcesContent === void 0 || x.sourcesContent === null || isArray(x.sourcesContent) && every(x.sourcesContent, isStringOrNull)) && (x.names === void 0 || x.names === null || isArray(x.names) && every(x.names, isString2));
122666
122666
  }
122667
122667
  function tryParseRawSourceMap(text) {
122668
122668
  try {
@@ -154445,7 +154445,7 @@ ${lanes.join("\n")}
154445
154445
  return output;
154446
154446
  }
154447
154447
  function flattenDiagnosticMessageText(diag2, newLine, indent3 = 0) {
154448
- if (isString(diag2)) {
154448
+ if (isString2(diag2)) {
154449
154449
  return diag2;
154450
154450
  } else if (diag2 === void 0) {
154451
154451
  return "";
@@ -154467,7 +154467,7 @@ ${lanes.join("\n")}
154467
154467
  return result;
154468
154468
  }
154469
154469
  function getModeForFileReference(ref, containingFileMode) {
154470
- return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
154470
+ return (isString2(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
154471
154471
  }
154472
154472
  function getModeForResolutionAtIndex(file, index, compilerOptions) {
154473
154473
  return getModeForUsageLocationWorker(file, getModuleNameStringLiteralAt(file, index), compilerOptions);
@@ -154575,7 +154575,7 @@ ${lanes.join("\n")}
154575
154575
  };
154576
154576
  }
154577
154577
  function getTypeReferenceResolutionName(entry) {
154578
- return !isString(entry) ? entry.fileName : entry;
154578
+ return !isString2(entry) ? entry.fileName : entry;
154579
154579
  }
154580
154580
  var typeReferenceResolutionNameAndModeGetter = {
154581
154581
  getName: getTypeReferenceResolutionName,
@@ -155341,8 +155341,8 @@ ${lanes.join("\n")}
155341
155341
  }
155342
155342
  function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, reusedNames) {
155343
155343
  var _a2, _b2;
155344
- const containingSourceFile = !isString(containingFile) ? containingFile : void 0;
155345
- const containingFileName = !isString(containingFile) ? getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile;
155344
+ const containingSourceFile = !isString2(containingFile) ? containingFile : void 0;
155345
+ const containingFileName = !isString2(containingFile) ? getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile;
155346
155346
  const redirectedReference = containingSourceFile && getRedirectReferenceForResolution(containingSourceFile);
155347
155347
  (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Program, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName });
155348
155348
  mark("beforeResolveTypeReference");
@@ -155432,7 +155432,7 @@ ${lanes.join("\n")}
155432
155432
  });
155433
155433
  }
155434
155434
  function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) {
155435
- const containingSourceFile = !isString(containingFile) ? containingFile : void 0;
155435
+ const containingSourceFile = !isString2(containingFile) ? containingFile : void 0;
155436
155436
  return resolveNamesReusingOldState({
155437
155437
  entries: typeDirectiveNames,
155438
155438
  containingFile,
@@ -157795,7 +157795,7 @@ ${lanes.join("\n")}
157795
157795
  }
157796
157796
  function fileExistsIfProjectReferenceDts(file) {
157797
157797
  const source = host.getRedirectFromOutput(host.toPath(file));
157798
- return source !== void 0 ? isString(source.source) ? originalFileExists.call(host.compilerHost, source.source) : true : void 0;
157798
+ return source !== void 0 ? isString2(source.source) ? originalFileExists.call(host.compilerHost, source.source) : true : void 0;
157799
157799
  }
157800
157800
  function directoryExistsIfProjectReferenceDeclDir(dir) {
157801
157801
  const dirPath = host.toPath(dir);
@@ -158198,7 +158198,7 @@ ${lanes.join("\n")}
158198
158198
  break;
158199
158199
  }
158200
158200
  const matchedByInclude = getMatchedIncludeSpec(program, fileName);
158201
- if (!matchedByInclude || !isString(matchedByInclude)) return void 0;
158201
+ if (!matchedByInclude || !isString2(matchedByInclude)) return void 0;
158202
158202
  configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
158203
158203
  message = Diagnostics.File_is_matched_by_include_pattern_specified_here;
158204
158204
  break;
@@ -158808,13 +158808,13 @@ ${lanes.join("\n")}
158808
158808
  oldEmitSignature
158809
158809
  ) : (
158810
158810
  // Convert to different format
158811
- isString(oldEmitSignature) ? [oldEmitSignature] : oldEmitSignature[0]
158811
+ isString2(oldEmitSignature) ? [oldEmitSignature] : oldEmitSignature[0]
158812
158812
  );
158813
158813
  }
158814
158814
  function repopulateDiagnostics(diagnostics, newProgram) {
158815
158815
  if (!diagnostics.length) return diagnostics;
158816
158816
  return sameMap(diagnostics, (diag2) => {
158817
- if (isString(diag2.messageText)) return diag2;
158817
+ if (isString2(diag2.messageText)) return diag2;
158818
158818
  const repopulatedChain = convertOrRepopulateDiagnosticMessageChain(diag2.messageText, diag2.file, newProgram, (chain) => {
158819
158819
  var _a;
158820
158820
  return (_a = chain.repopulateInfo) == null ? void 0 : _a.call(chain);
@@ -158865,7 +158865,7 @@ ${lanes.join("\n")}
158865
158865
  return {
158866
158866
  ...diagnostic,
158867
158867
  file: sourceFile,
158868
- messageText: isString(diagnostic.messageText) ? diagnostic.messageText : convertOrRepopulateDiagnosticMessageChain(diagnostic.messageText, sourceFile, newProgram, (chain) => chain.info)
158868
+ messageText: isString2(diagnostic.messageText) ? diagnostic.messageText : convertOrRepopulateDiagnosticMessageChain(diagnostic.messageText, sourceFile, newProgram, (chain) => chain.info)
158869
158869
  };
158870
158870
  }
158871
158871
  function releaseCache(state) {
@@ -159277,7 +159277,7 @@ ${lanes.join("\n")}
159277
159277
  emitSignature === void 0 ? fileId : (
159278
159278
  // There is no emit, encode as false
159279
159279
  // fileId, signature: emptyArray if signature only differs in dtsMap option than our own compilerOptions otherwise EmitSignature
159280
- [fileId, !isString(emitSignature) && emitSignature[0] === actualSignature ? emptyArray : emitSignature]
159280
+ [fileId, !isString2(emitSignature) && emitSignature[0] === actualSignature ? emptyArray : emitSignature]
159281
159281
  )
159282
159282
  );
159283
159283
  }
@@ -159477,7 +159477,7 @@ ${lanes.join("\n")}
159477
159477
  return {
159478
159478
  ...diagnostic,
159479
159479
  file: file ? file.resolvedPath === diagnosticFilePath ? void 0 : relativeToBuildInfo(file.resolvedPath) : false,
159480
- messageText: isString(diagnostic.messageText) ? diagnostic.messageText : toReusableDiagnosticMessageChain(diagnostic.messageText)
159480
+ messageText: isString2(diagnostic.messageText) ? diagnostic.messageText : toReusableDiagnosticMessageChain(diagnostic.messageText)
159481
159481
  };
159482
159482
  }
159483
159483
  function toReusableDiagnosticMessageChain(chain) {
@@ -159559,7 +159559,7 @@ ${lanes.join("\n")}
159559
159559
  }
159560
159560
  return (host.createHash ?? generateDjb2Hash)(text);
159561
159561
  function flattenDiagnosticMessageText2(diagnostic) {
159562
- return isString(diagnostic) ? diagnostic : diagnostic === void 0 ? "" : !diagnostic.next ? diagnostic.messageText : diagnostic.messageText + diagnostic.next.map(flattenDiagnosticMessageText2).join("\n");
159562
+ return isString2(diagnostic) ? diagnostic : diagnostic === void 0 ? "" : !diagnostic.next ? diagnostic.messageText : diagnostic.messageText + diagnostic.next.map(flattenDiagnosticMessageText2).join("\n");
159563
159563
  }
159564
159564
  function locationInfo(diagnostic) {
159565
159565
  if (diagnostic.file.resolvedPath === sourceFile.resolvedPath) return `(${diagnostic.start},${diagnostic.length})`;
@@ -159803,7 +159803,7 @@ ${lanes.join("\n")}
159803
159803
  else if (host.writeFile) host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
159804
159804
  else state.program.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
159805
159805
  function handleNewSignature(oldSignatureFormat, newSignature) {
159806
- const oldSignature = !oldSignatureFormat || isString(oldSignatureFormat) ? oldSignatureFormat : oldSignatureFormat[0];
159806
+ const oldSignature = !oldSignatureFormat || isString2(oldSignatureFormat) ? oldSignatureFormat : oldSignatureFormat[0];
159807
159807
  newSignature ?? (newSignature = computeSignature(text, host, data));
159808
159808
  if (newSignature === oldSignature) {
159809
159809
  if (oldSignatureFormat === oldSignature) return void 0;
@@ -159986,7 +159986,7 @@ ${lanes.join("\n")}
159986
159986
  (_b = state.emitDiagnosticsPerFile) == null ? void 0 : _b.delete(affectedFilePendingEmit);
159987
159987
  }
159988
159988
  function toBuilderStateFileInfoForMultiEmit(fileInfo) {
159989
- return isString(fileInfo) ? { version: fileInfo, signature: fileInfo, affectsGlobalScope: void 0, impliedFormat: void 0 } : isString(fileInfo.signature) ? fileInfo : { version: fileInfo.version, signature: fileInfo.signature === false ? void 0 : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
159989
+ return isString2(fileInfo) ? { version: fileInfo, signature: fileInfo, affectsGlobalScope: void 0, impliedFormat: void 0 } : isString2(fileInfo.signature) ? fileInfo : { version: fileInfo.version, signature: fileInfo.signature === false ? void 0 : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
159990
159990
  }
159991
159991
  function toBuilderFileEmit(value, fullEmitForOptions) {
159992
159992
  return isNumber(value) ? fullEmitForOptions : value[1] || 24;
@@ -160007,7 +160007,7 @@ ${lanes.join("\n")}
160007
160007
  if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
160008
160008
  buildInfo.fileInfos.forEach((fileInfo, index) => {
160009
160009
  const path5 = toFilePath(index + 1);
160010
- fileInfos.set(path5, isString(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo);
160010
+ fileInfos.set(path5, isString2(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo);
160011
160011
  });
160012
160012
  state = {
160013
160013
  fileInfos,
@@ -160037,7 +160037,7 @@ ${lanes.join("\n")}
160037
160037
  const key = toFilePath(value[0]);
160038
160038
  emitSignatures.set(
160039
160039
  key,
160040
- !isString(value[1]) && !value[1].length ? (
160040
+ !isString2(value[1]) && !value[1].length ? (
160041
160041
  // File signature is emit signature but differs in map
160042
160042
  [emitSignatures.get(key)]
160043
160043
  ) : value[1]
@@ -160127,7 +160127,7 @@ ${lanes.join("\n")}
160127
160127
  const resolvedRoots = new Map(program.resolvedRoot);
160128
160128
  program.fileInfos.forEach((fileInfo, index) => {
160129
160129
  const path5 = toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName);
160130
- const version2 = isString(fileInfo) ? fileInfo : fileInfo.version;
160130
+ const version2 = isString2(fileInfo) ? fileInfo : fileInfo.version;
160131
160131
  fileInfos.set(path5, version2);
160132
160132
  if (rootIndex < program.root.length) {
160133
160133
  const current = program.root[rootIndex];
@@ -161667,7 +161667,7 @@ ${lanes.join("\n")}
161667
161667
  Diagnostics.Part_of_files_list_in_tsconfig_json
161668
161668
  );
161669
161669
  const matchedByInclude = getMatchedIncludeSpec(program, fileName);
161670
- return isString(matchedByInclude) ? chainDiagnosticMessages(
161670
+ return isString2(matchedByInclude) ? chainDiagnosticMessages(
161671
161671
  /*details*/
161672
161672
  void 0,
161673
161673
  Diagnostics.Matched_by_include_pattern_0_in_1,
@@ -161720,7 +161720,7 @@ ${lanes.join("\n")}
161720
161720
  }
161721
161721
  }
161722
161722
  function toFileName(file, fileNameConvertor) {
161723
- const fileName = isString(file) ? file : file.fileName;
161723
+ const fileName = isString2(file) ? file : file.fileName;
161724
161724
  return fileNameConvertor ? fileNameConvertor(fileName) : fileName;
161725
161725
  }
161726
161726
  function emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummary, writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers) {
@@ -173664,7 +173664,7 @@ ${lanes.join("\n")}
173664
173664
  for (const location of possibleMapLocations) {
173665
173665
  const mapFileName2 = getNormalizedAbsolutePath(location, getDirectoryPath(generatedFileName));
173666
173666
  const mapFileContents = readMapFile(mapFileName2, originalMapFileName);
173667
- if (isString(mapFileContents)) {
173667
+ if (isString2(mapFileContents)) {
173668
173668
  return convertDocumentToSourceMapper(host, mapFileContents, mapFileName2);
173669
173669
  }
173670
173670
  if (mapFileContents !== void 0) {
@@ -173678,7 +173678,7 @@ ${lanes.join("\n")}
173678
173678
  if (!map2 || !map2.sources || !map2.file || !map2.mappings) {
173679
173679
  return void 0;
173680
173680
  }
173681
- if (map2.sourcesContent && map2.sourcesContent.some(isString)) return void 0;
173681
+ if (map2.sourcesContent && map2.sourcesContent.some(isString2)) return void 0;
173682
173682
  return createDocumentPositionMapper(host, map2, mapFileName);
173683
173683
  }
173684
173684
  function createSourceFileLike(text, lineMap) {
@@ -174078,7 +174078,7 @@ interface Symbol {
174078
174078
  continue;
174079
174079
  }
174080
174080
  const value = options[opt.name];
174081
- if (isString(value)) {
174081
+ if (isString2(value)) {
174082
174082
  options[opt.name] = parseCustomTypeOption(opt, value, diagnostics);
174083
174083
  } else {
174084
174084
  if (!forEachEntry(opt.type, (v) => v === value)) {
@@ -184166,7 +184166,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
184166
184166
  return flatMap(registrations, (f) => map(f.getCodeActions(context), removeFixIdIfFixAllUnavailable(f, diagnostics)));
184167
184167
  }
184168
184168
  function getAllFixes(context) {
184169
- return fixIdToRegistration.get(cast(context.fixId, isString)).getAllCodeActions(context);
184169
+ return fixIdToRegistration.get(cast(context.fixId, isString2)).getAllCodeActions(context);
184170
184170
  }
184171
184171
  function createCombinedCodeActions(changes, commands) {
184172
184172
  return { changes, commands };
@@ -188968,7 +188968,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
188968
188968
  function addMissingConstraint(changes, program, preferences, host, sourceFile, info2) {
188969
188969
  const { declaration, constraint } = info2;
188970
188970
  const checker = program.getTypeChecker();
188971
- if (isString(constraint)) {
188971
+ if (isString2(constraint)) {
188972
188972
  changes.insertText(sourceFile, declaration.name.end, ` extends ${constraint}`);
188973
188973
  } else {
188974
188974
  const scriptTarget = getEmitScriptTarget(program.getCompilerOptions());
@@ -196980,7 +196980,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
196980
196980
  });
196981
196981
  }
196982
196982
  function completionNameForLiteral(sourceFile, preferences, literal) {
196983
- return typeof literal === "object" ? pseudoBigIntToString(literal) + "n" : isString(literal) ? quote(sourceFile, preferences, literal) : JSON.stringify(literal);
196983
+ return typeof literal === "object" ? pseudoBigIntToString(literal) + "n" : isString2(literal) ? quote(sourceFile, preferences, literal) : JSON.stringify(literal);
196984
196984
  }
196985
196985
  function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
196986
196986
  return {
@@ -201107,7 +201107,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
201107
201107
  return void 0;
201108
201108
  }
201109
201109
  const parsed = tryParsePattern(pattern);
201110
- if (parsed === void 0 || isString(parsed)) {
201110
+ if (parsed === void 0 || isString2(parsed)) {
201111
201111
  return void 0;
201112
201112
  }
201113
201113
  const normalizedPrefix = resolvePath(parsed.prefix);
@@ -201130,7 +201130,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
201130
201130
  declarationExtension && changeExtension(normalizedSuffix, declarationExtension),
201131
201131
  ...inputExtension ? inputExtension.map((ext) => changeExtension(normalizedSuffix, ext)) : [],
201132
201132
  normalizedSuffix
201133
- ].filter(isString);
201133
+ ].filter(isString2);
201134
201134
  const includeGlobs = normalizedSuffix ? matchingSuffixes.map((suffix) => "**/*" + suffix) : ["./*"];
201135
201135
  const isExportsOrImportsWildcard = (isExports || isImports) && endsWith(pattern, "/*");
201136
201136
  let matches = getMatchesWithPrefix(baseDirectory);
@@ -206372,7 +206372,7 @@ ${content}
206372
206372
  }
206373
206373
  function hasModuleDeclarationMatchingSpecifier(sourceFile, moduleSpecifier) {
206374
206374
  const moduleSpecifierText = isStringLiteral(moduleSpecifier) && moduleSpecifier.text;
206375
- return isString(moduleSpecifierText) && some(sourceFile.moduleAugmentations, (moduleName) => isStringLiteral(moduleName) && moduleName.text === moduleSpecifierText);
206375
+ return isString2(moduleSpecifierText) && some(sourceFile.moduleAugmentations, (moduleName) => isStringLiteral(moduleName) && moduleName.text === moduleSpecifierText);
206376
206376
  }
206377
206377
  function getNewImportSpecifiers(namedImports) {
206378
206378
  return flatMap(namedImports, (namedImport) => map(tryGetNamedBindingElements(namedImport), (importSpecifier) => importSpecifier.name && importSpecifier.propertyName && moduleExportNameTextEscaped(importSpecifier.name) === moduleExportNameTextEscaped(importSpecifier.propertyName) ? factory.updateImportSpecifier(
@@ -209270,7 +209270,7 @@ ${content}
209270
209270
  this.insertNodeAt(sourceFile, fnStart, tag, { suffix: this.newLineCharacter + indent3 });
209271
209271
  }
209272
209272
  createJSDocText(sourceFile, node) {
209273
- const comments = flatMap(node.jsDoc, (jsDoc2) => isString(jsDoc2.comment) ? factory.createJSDocText(jsDoc2.comment) : jsDoc2.comment);
209273
+ const comments = flatMap(node.jsDoc, (jsDoc2) => isString2(jsDoc2.comment) ? factory.createJSDocText(jsDoc2.comment) : jsDoc2.comment);
209274
209274
  const jsDoc = singleOrUndefined(node.jsDoc);
209275
209275
  return jsDoc && positionsAreOnSameLine(jsDoc.pos, jsDoc.end, sourceFile) && length(comments) === 0 ? void 0 : factory.createNodeArray(intersperse(comments, factory.createJSDocText("\n")));
209276
209276
  }
@@ -216039,7 +216039,7 @@ ${options.prefix}` : "\n" : options.prefix
216039
216039
  isStatementWithLocals: () => isStatementWithLocals,
216040
216040
  isStatic: () => isStatic,
216041
216041
  isStaticModifier: () => isStaticModifier,
216042
- isString: () => isString,
216042
+ isString: () => isString2,
216043
216043
  isStringANonContextualKeyword: () => isStringANonContextualKeyword,
216044
216044
  isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection,
216045
216045
  isStringDoubleQuoted: () => isStringDoubleQuoted,
@@ -218046,7 +218046,7 @@ ${options.prefix}` : "\n" : options.prefix
218046
218046
  }
218047
218047
  /** @internal */
218048
218048
  closeSourceMapFileWatcher() {
218049
- if (this.sourceMapFilePath && !isString(this.sourceMapFilePath)) {
218049
+ if (this.sourceMapFilePath && !isString2(this.sourceMapFilePath)) {
218050
218050
  closeFileWatcherOf(this.sourceMapFilePath);
218051
218051
  this.sourceMapFilePath = void 0;
218052
218052
  }
@@ -218163,11 +218163,11 @@ ${options.prefix}` : "\n" : options.prefix
218163
218163
  return true;
218164
218164
  }
218165
218165
  const set = /* @__PURE__ */ new Map();
218166
- let unique = 0;
218166
+ let unique2 = 0;
218167
218167
  for (const v of arr1) {
218168
218168
  if (set.get(v) !== true) {
218169
218169
  set.set(v, true);
218170
- unique++;
218170
+ unique2++;
218171
218171
  }
218172
218172
  }
218173
218173
  for (const v of arr2) {
@@ -218177,10 +218177,10 @@ ${options.prefix}` : "\n" : options.prefix
218177
218177
  }
218178
218178
  if (isSet === true) {
218179
218179
  set.set(v, false);
218180
- unique--;
218180
+ unique2--;
218181
218181
  }
218182
218182
  }
218183
- return unique === 0;
218183
+ return unique2 === 0;
218184
218184
  }
218185
218185
  function typeAcquisitionChanged(opt1, opt2) {
218186
218186
  return opt1.enable !== opt2.enable || !setIsEqualTo(opt1.include, opt2.include) || !setIsEqualTo(opt1.exclude, opt2.exclude);
@@ -220568,7 +220568,7 @@ ${options.prefix}` : "\n" : options.prefix
220568
220568
  }
220569
220569
  };
220570
220570
  function convertFormatOptions(protocolOptions) {
220571
- if (isString(protocolOptions.indentStyle)) {
220571
+ if (isString2(protocolOptions.indentStyle)) {
220572
220572
  protocolOptions.indentStyle = indentStyle.get(protocolOptions.indentStyle.toLowerCase());
220573
220573
  Debug.assert(protocolOptions.indentStyle !== void 0);
220574
220574
  }
@@ -220577,7 +220577,7 @@ ${options.prefix}` : "\n" : options.prefix
220577
220577
  function convertCompilerOptions(protocolOptions) {
220578
220578
  compilerOptionConverters.forEach((mappedValues, id) => {
220579
220579
  const propertyValue = protocolOptions[id];
220580
- if (isString(propertyValue)) {
220580
+ if (isString2(propertyValue)) {
220581
220581
  protocolOptions[id] = mappedValues.get(propertyValue.toLowerCase());
220582
220582
  }
220583
220583
  });
@@ -220590,7 +220590,7 @@ ${options.prefix}` : "\n" : options.prefix
220590
220590
  const propertyValue = protocolOptions[option.name];
220591
220591
  if (propertyValue === void 0) return;
220592
220592
  const mappedValues = watchOptionsConverters.get(option.name);
220593
- (watchOptions || (watchOptions = {}))[option.name] = mappedValues ? isString(propertyValue) ? mappedValues.get(propertyValue.toLowerCase()) : propertyValue : convertJsonOption(option, propertyValue, currentDirectory || "", errors || (errors = []));
220593
+ (watchOptions || (watchOptions = {}))[option.name] = mappedValues ? isString2(propertyValue) ? mappedValues.get(propertyValue.toLowerCase()) : propertyValue : convertJsonOption(option, propertyValue, currentDirectory || "", errors || (errors = []));
220594
220594
  });
220595
220595
  return watchOptions && { watchOptions, errors };
220596
220596
  }
@@ -220604,7 +220604,7 @@ ${options.prefix}` : "\n" : options.prefix
220604
220604
  return result;
220605
220605
  }
220606
220606
  function tryConvertScriptKindName(scriptKindName) {
220607
- return isString(scriptKindName) ? convertScriptKindName(scriptKindName) : scriptKindName;
220607
+ return isString2(scriptKindName) ? convertScriptKindName(scriptKindName) : scriptKindName;
220608
220608
  }
220609
220609
  function convertScriptKindName(scriptKindName) {
220610
220610
  switch (scriptKindName) {
@@ -220673,7 +220673,7 @@ ${options.prefix}` : "\n" : options.prefix
220673
220673
  const configFileForOpenFile = cache.get(info2.path);
220674
220674
  if (configFileForOpenFile === void 0) return void 0;
220675
220675
  if (!isAncestorConfigFileInfo(info2)) {
220676
- return isString(configFileForOpenFile) || !configFileForOpenFile ? configFileForOpenFile : (
220676
+ return isString2(configFileForOpenFile) || !configFileForOpenFile ? configFileForOpenFile : (
220677
220677
  // direct result
220678
220678
  configFileForOpenFile.get(
220679
220679
  /*key*/
@@ -220681,7 +220681,7 @@ ${options.prefix}` : "\n" : options.prefix
220681
220681
  )
220682
220682
  );
220683
220683
  } else {
220684
- return configFileForOpenFile && !isString(configFileForOpenFile) ? (
220684
+ return configFileForOpenFile && !isString2(configFileForOpenFile) ? (
220685
220685
  // Map with fileName as key
220686
220686
  configFileForOpenFile.get(info2.fileName)
220687
220687
  ) : void 0;
@@ -220862,7 +220862,7 @@ ${options.prefix}` : "\n" : options.prefix
220862
220862
  );
220863
220863
  }
220864
220864
  function getDetailWatchInfo(watchType, project) {
220865
- return `${isString(project) ? `Config: ${project} ` : project ? `Project: ${project.getProjectName()} ` : ""}WatchType: ${watchType}`;
220865
+ return `${isString2(project) ? `Config: ${project} ` : project ? `Project: ${project.getProjectName()} ` : ""}WatchType: ${watchType}`;
220866
220866
  }
220867
220867
  function isScriptInfoWatchedFromNodeModules(info2) {
220868
220868
  return !info2.isScriptOpen() && info2.mTime !== void 0;
@@ -221395,7 +221395,7 @@ ${options.prefix}` : "\n" : options.prefix
221395
221395
  }
221396
221396
  /** @internal */
221397
221397
  tryGetDefaultProjectForFile(fileNameOrScriptInfo) {
221398
- const scriptInfo = isString(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo;
221398
+ const scriptInfo = isString2(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo;
221399
221399
  return scriptInfo && !scriptInfo.isOrphan() ? scriptInfo.getDefaultProject() : void 0;
221400
221400
  }
221401
221401
  /**
@@ -221404,7 +221404,7 @@ ${options.prefix}` : "\n" : options.prefix
221404
221404
  */
221405
221405
  tryGetDefaultProjectForEnsuringConfiguredProjectForFile(fileNameOrScriptInfo) {
221406
221406
  var _a;
221407
- const scriptInfo = isString(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo;
221407
+ const scriptInfo = isString2(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo;
221408
221408
  if (!scriptInfo) return void 0;
221409
221409
  if ((_a = this.pendingOpenFileProjectUpdates) == null ? void 0 : _a.delete(scriptInfo.path)) {
221410
221410
  this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(
@@ -221424,8 +221424,8 @@ ${options.prefix}` : "\n" : options.prefix
221424
221424
  }
221425
221425
  doEnsureDefaultProjectForFile(fileNameOrScriptInfo) {
221426
221426
  this.ensureProjectStructuresUptoDate();
221427
- const scriptInfo = isString(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo;
221428
- return scriptInfo ? scriptInfo.getDefaultProject() : (this.logErrorForScriptInfoNotFound(isString(fileNameOrScriptInfo) ? fileNameOrScriptInfo : fileNameOrScriptInfo.fileName), Errors.ThrowNoProject());
221427
+ const scriptInfo = isString2(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo;
221428
+ return scriptInfo ? scriptInfo.getDefaultProject() : (this.logErrorForScriptInfoNotFound(isString2(fileNameOrScriptInfo) ? fileNameOrScriptInfo : fileNameOrScriptInfo.fileName), Errors.ThrowNoProject());
221429
221429
  }
221430
221430
  getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName) {
221431
221431
  this.ensureProjectStructuresUptoDate();
@@ -221486,7 +221486,7 @@ ${options.prefix}` : "\n" : options.prefix
221486
221486
  }
221487
221487
  handleSourceMapProjects(info2) {
221488
221488
  if (info2.sourceMapFilePath) {
221489
- if (isString(info2.sourceMapFilePath)) {
221489
+ if (isString2(info2.sourceMapFilePath)) {
221490
221490
  const sourceMapFileInfo = this.getScriptInfoForPath(info2.sourceMapFilePath);
221491
221491
  this.delayUpdateSourceInfoProjects(sourceMapFileInfo == null ? void 0 : sourceMapFileInfo.sourceInfos);
221492
221492
  } else {
@@ -222061,7 +222061,7 @@ ${options.prefix}` : "\n" : options.prefix
222061
222061
  this.configFileForOpenFiles.set(info2.path, config);
222062
222062
  } else {
222063
222063
  let configFileForOpenFile = this.configFileForOpenFiles.get(info2.path);
222064
- if (!configFileForOpenFile || isString(configFileForOpenFile)) {
222064
+ if (!configFileForOpenFile || isString2(configFileForOpenFile)) {
222065
222065
  this.configFileForOpenFiles.set(
222066
222066
  info2.path,
222067
222067
  configFileForOpenFile = (/* @__PURE__ */ new Map()).set(false, configFileForOpenFile)
@@ -222313,9 +222313,9 @@ ${options.prefix}` : "\n" : options.prefix
222313
222313
  }
222314
222314
  const cachedDirectoryStructureHost = ((_a = configFileExistenceInfo.config) == null ? void 0 : _a.cachedDirectoryStructureHost) || createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames);
222315
222315
  const configFileContent = tryReadFile(configFilename, (fileName) => this.host.readFile(fileName));
222316
- const configFile = parseJsonText(configFilename, isString(configFileContent) ? configFileContent : "");
222316
+ const configFile = parseJsonText(configFilename, isString2(configFileContent) ? configFileContent : "");
222317
222317
  const configFileErrors = configFile.parseDiagnostics;
222318
- if (!isString(configFileContent)) configFileErrors.push(configFileContent);
222318
+ if (!isString2(configFileContent)) configFileErrors.push(configFileContent);
222319
222319
  const configDir = getDirectoryPath(configFilename);
222320
222320
  const parsedCommandLine = parseJsonSourceFileConfigFileContent(
222321
222321
  configFile,
@@ -222992,7 +222992,7 @@ Dynamic files must always be opened with service's current directory or service
222992
222992
  return void 0;
222993
222993
  }
222994
222994
  declarationInfo.getSnapshot();
222995
- if (isString(declarationInfo.sourceMapFilePath)) {
222995
+ if (isString2(declarationInfo.sourceMapFilePath)) {
222996
222996
  const sourceMapFileInfo2 = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath);
222997
222997
  if (sourceMapFileInfo2) {
222998
222998
  sourceMapFileInfo2.getSnapshot();
@@ -223032,7 +223032,7 @@ Dynamic files must always be opened with service's current directory or service
223032
223032
  );
223033
223033
  readMapFile = void 0;
223034
223034
  if (sourceMapFileInfo) {
223035
- if (!isString(sourceMapFileInfo)) {
223035
+ if (!isString2(sourceMapFileInfo)) {
223036
223036
  declarationInfo.sourceMapFilePath = sourceMapFileInfo.path;
223037
223037
  sourceMapFileInfo.declarationInfoPath = declarationInfo.path;
223038
223038
  if (!sourceMapFileInfo.deferredDelete) sourceMapFileInfo.documentPositionMapper = documentPositionMapper || false;
@@ -223069,7 +223069,7 @@ Dynamic files must always be opened with service's current directory or service
223069
223069
  mapFileName,
223070
223070
  () => {
223071
223071
  const declarationInfo = this.getScriptInfoForPath(declarationInfoPath);
223072
- if (declarationInfo && declarationInfo.sourceMapFilePath && !isString(declarationInfo.sourceMapFilePath)) {
223072
+ if (declarationInfo && declarationInfo.sourceMapFilePath && !isString2(declarationInfo.sourceMapFilePath)) {
223073
223073
  this.delayUpdateProjectGraphs(
223074
223074
  declarationInfo.containingProjects,
223075
223075
  /*clearSourceMapperCache*/
@@ -223101,7 +223101,7 @@ Dynamic files must always be opened with service's current directory or service
223101
223101
  false
223102
223102
  );
223103
223103
  if (!info2) return void 0;
223104
- if (declarationInfo && isString(declarationInfo.sourceMapFilePath) && info2 !== declarationInfo) {
223104
+ if (declarationInfo && isString2(declarationInfo.sourceMapFilePath) && info2 !== declarationInfo) {
223105
223105
  const sourceMapInfo = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath);
223106
223106
  if (sourceMapInfo) {
223107
223107
  (sourceMapInfo.sourceInfos ?? (sourceMapInfo.sourceInfos = /* @__PURE__ */ new Set())).add(info2.path);
@@ -223873,7 +223873,7 @@ Dynamic files must always be opened with service's current directory or service
223873
223873
  if (!info2.isScriptOpen() && info2.isOrphan() && !scriptInfoIsContainedByDeferredClosedProject(info2) && !scriptInfoIsContainedByBackgroundProject(info2)) {
223874
223874
  if (!info2.sourceMapFilePath) return;
223875
223875
  let sourceInfos;
223876
- if (isString(info2.sourceMapFilePath)) {
223876
+ if (isString2(info2.sourceMapFilePath)) {
223877
223877
  const sourceMapInfo = this.filenameToScriptInfo.get(info2.sourceMapFilePath);
223878
223878
  sourceInfos = sourceMapInfo == null ? void 0 : sourceMapInfo.sourceInfos;
223879
223879
  } else {
@@ -223890,7 +223890,7 @@ Dynamic files must always be opened with service's current directory or service
223890
223890
  toRemoveScriptInfos.delete(info2.path);
223891
223891
  if (info2.sourceMapFilePath) {
223892
223892
  let sourceInfos;
223893
- if (isString(info2.sourceMapFilePath)) {
223893
+ if (isString2(info2.sourceMapFilePath)) {
223894
223894
  const sourceMapInfo = this.filenameToScriptInfo.get(info2.sourceMapFilePath);
223895
223895
  if (sourceMapInfo == null ? void 0 : sourceMapInfo.deferredDelete) {
223896
223896
  info2.sourceMapFilePath = {
@@ -224090,7 +224090,7 @@ Dynamic files must always be opened with service's current directory or service
224090
224090
  const processedRule = root.replace(rule2.match, (...groups) => {
224091
224091
  return exclude.map((groupNumberOrString) => {
224092
224092
  if (typeof groupNumberOrString === "number") {
224093
- if (!isString(groups[groupNumberOrString])) {
224093
+ if (!isString2(groups[groupNumberOrString])) {
224094
224094
  this.logger.info(`Incorrect RegExp specification in safelist rule ${name} - not enough groups`);
224095
224095
  return "\\*";
224096
224096
  }
@@ -226537,7 +226537,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
226537
226537
  }
226538
226538
  let ranges;
226539
226539
  let item = checkList[index];
226540
- if (isString(item)) {
226540
+ if (isString2(item)) {
226541
226541
  item = this.toPendingErrorCheck(item);
226542
226542
  } else if ("ranges" in item) {
226543
226543
  ranges = item.ranges;
@@ -230093,6 +230093,7 @@ var ERC8021_SUFFIX = "0x80218021802180218021802180218021";
230093
230093
  var SCHEMA_CANONICAL_REGISTRY = 0;
230094
230094
  var SCHEMA_CUSTOM_REGISTRY = 1;
230095
230095
  var MAX_CODES_BYTE_LENGTH = 255;
230096
+ var BUILDER_CODE_PATTERN = /^[a-z0-9_]{1,32}$/;
230096
230097
  var encoder = new TextEncoder();
230097
230098
  var decoder = new TextDecoder();
230098
230099
  function isHex(value) {
@@ -230156,7 +230157,7 @@ function createDataSuffix(input) {
230156
230157
  return concatHex([codesHex, codesLengthHex, schemaIdHex, ERC8021_SUFFIX]);
230157
230158
  }
230158
230159
  function getSchemaId(input) {
230159
- if (input.id === SCHEMA_CUSTOM_REGISTRY || "codeRegistry" in input || "codeRegistryAddress" in input) {
230160
+ if (input.id === SCHEMA_CUSTOM_REGISTRY || "codeRegistry" in input) {
230160
230161
  return SCHEMA_CUSTOM_REGISTRY;
230161
230162
  }
230162
230163
  return SCHEMA_CANONICAL_REGISTRY;
@@ -230166,18 +230167,28 @@ function normalizeCodes(codes) {
230166
230167
  throw new Error("At least one Builder Code is required");
230167
230168
  }
230168
230169
  return codes.map((code) => {
230169
- const normalized = code.trim();
230170
- if (normalized.length === 0) {
230170
+ if (typeof code !== "string") {
230171
+ throw new Error("Builder Codes must be strings");
230172
+ }
230173
+ if (code.length === 0) {
230171
230174
  throw new Error("Builder Codes cannot be empty");
230172
230175
  }
230173
- if (normalized.includes(",")) {
230176
+ if (code.trim() !== code) {
230177
+ throw new Error("Builder Codes cannot be padded");
230178
+ }
230179
+ if (code.includes(",")) {
230174
230180
  throw new Error("Builder Codes cannot contain commas");
230175
230181
  }
230176
- return normalized;
230182
+ if (!BUILDER_CODE_PATTERN.test(code)) {
230183
+ throw new Error(
230184
+ `Builder Code "${code}" must be 1-32 lowercase letters, digits, or underscores`
230185
+ );
230186
+ }
230187
+ return code;
230177
230188
  });
230178
230189
  }
230179
230190
  function registryToData(input) {
230180
- const address = input.codeRegistry?.address ?? input.codeRegistryAddress;
230191
+ const address = input.codeRegistry?.address;
230181
230192
  if (!address) {
230182
230193
  throw new Error("schema 1 attribution requires codeRegistry.address");
230183
230194
  }
@@ -230187,12 +230198,36 @@ function registryToData(input) {
230187
230198
  }
230188
230199
  const chainId = input.codeRegistry?.chainId;
230189
230200
  if (chainId === void 0) {
230190
- return address.toLowerCase();
230201
+ throw new Error("schema 1 attribution requires codeRegistry.chainId");
230202
+ }
230203
+ if (typeof chainId === "number" && (!Number.isSafeInteger(chainId) || chainId < 0)) {
230204
+ throw new Error("codeRegistry.chainId must be a non-negative safe integer or bigint");
230191
230205
  }
230192
230206
  const chainIdHex = bigintToMinimalHex(typeof chainId === "bigint" ? chainId : BigInt(chainId));
230193
230207
  const chainIdLengthHex = numberToByteHex(hexByteLength(chainIdHex));
230194
230208
  return concatHex([address.toLowerCase(), chainIdHex, chainIdLengthHex]);
230195
230209
  }
230210
+ function validateBuilderCodes(codes) {
230211
+ const errors = [];
230212
+ if (codes.length === 0) {
230213
+ errors.push("at least one Builder Code is required");
230214
+ }
230215
+ for (const code of codes) {
230216
+ if (code.trim() !== code || code.length === 0) {
230217
+ errors.push("Builder Codes cannot be empty or padded");
230218
+ }
230219
+ if (code.includes(",")) {
230220
+ errors.push(`Builder Code "${code}" contains a comma`);
230221
+ }
230222
+ if (!BUILDER_CODE_PATTERN.test(code)) {
230223
+ errors.push(`Builder Code "${code}" must be 1-32 lowercase letters, digits, or underscores`);
230224
+ }
230225
+ }
230226
+ return unique(errors);
230227
+ }
230228
+ function unique(values) {
230229
+ return Array.from(new Set(values));
230230
+ }
230196
230231
 
230197
230232
  // ../scanner/dist/index.js
230198
230233
  var import_typescript = __toESM(require_typescript(), 1);
@@ -230222,10 +230257,11 @@ var SKIPPED_DIRECTORIES = /* @__PURE__ */ new Set([
230222
230257
  "dist",
230223
230258
  "node_modules"
230224
230259
  ]);
230225
- var BUILDER_CODE_REGEX = /\bbc_[A-Za-z0-9._:-]+\b/g;
230226
- var ATTRIBUTION_HELPER_REGEX = /\b(?:appendDataSuffix|attributeSendCalls|attributeUserOperation|Attribution\.toDataSuffix|BuilderCodeClientExtension|builderCodeDataSuffix|createAttributionProvider|createAttributionSigner|createDataSuffix|dataSuffix|declareBuilderCodeExtension|ethersBuilderCodeDataSuffix|sendAttributedCalls|useAttributionSuffix|validateUserOperationAttribution|withAttributionSuffix|withEthersAttribution|withUserOperationAttribution|withViemDataSuffix)\b/;
230260
+ var BUILDER_CODE_REGEX = /\bbc_[a-z0-9_]{1,29}\b/g;
230261
+ var ATTRIBUTION_HELPER_REGEX = /\b(?:appendDataSuffix|attributeSendCalls|attributeUserOperation|Attribution\.toDataSuffix|BuilderCodeClientExtension|builderCodeDataSuffix|createAttributionProvider|createAttributionSigner|createDataSuffix|dataSuffix|declareBuilderCodeExtension|ethersBuilderCodeDataSuffix|sendAttributedCalls|useAttributionSuffix|validateUserOperationAttribution|withAttributionSuffix|withDataSuffixCapability|withEthersAttribution|withUserOperationAttribution|withViemDataSuffix)\b/;
230227
230262
  var AGENT_MARKER_REGEX = /\b(?:agentTransactionTool|executeTransaction|onchainAction|sendTransactionTool|transactionTool)\b/;
230228
230263
  async function analyzeProject(options) {
230264
+ assertBuilderCodes(options.builderCodes);
230229
230265
  const root = import_path.default.resolve(options.root);
230230
230266
  const profile = normalizeProfile(options.profile);
230231
230267
  const baseline = await readBaseline(root, options.baseline);
@@ -230264,6 +230300,7 @@ async function analyzeProject(options) {
230264
230300
  };
230265
230301
  }
230266
230302
  function analyzeSource(source, options) {
230303
+ assertBuilderCodes(options.builderCodes);
230267
230304
  const relativePath = options.relativePath ?? "source.ts";
230268
230305
  const profile = normalizeProfile(options.profile);
230269
230306
  const sourceFile = import_typescript.default.createSourceFile(
@@ -230275,13 +230312,21 @@ function analyzeSource(source, options) {
230275
230312
  );
230276
230313
  const frameworks = detectFrameworks(source);
230277
230314
  const candidates = collectCandidates(sourceFile, source, frameworks);
230278
- return candidates.map(
230279
- (candidate) => evaluateCandidate(sourceFile, source, candidate, {
230315
+ const fingerprintOccurrences = /* @__PURE__ */ new Map();
230316
+ return candidates.map((candidate) => {
230317
+ const fingerprintKey = [
230318
+ candidate.family,
230319
+ candidate.marker,
230320
+ normalizeFingerprintSource(candidate.node.getText(sourceFile))
230321
+ ].join(":");
230322
+ const fingerprintOccurrence = (fingerprintOccurrences.get(fingerprintKey) ?? 0) + 1;
230323
+ fingerprintOccurrences.set(fingerprintKey, fingerprintOccurrence);
230324
+ return evaluateCandidate(sourceFile, source, candidate, fingerprintOccurrence, {
230280
230325
  ...options,
230281
230326
  profile,
230282
230327
  relativePath
230283
- })
230284
- );
230328
+ });
230329
+ });
230285
230330
  }
230286
230331
  function detectFrameworks(source) {
230287
230332
  const frameworks = /* @__PURE__ */ new Set();
@@ -230300,7 +230345,7 @@ function detectFrameworks(source) {
230300
230345
  if (/@x402\//.test(source)) {
230301
230346
  frameworks.add("x402");
230302
230347
  }
230303
- if (/\b(?:createAttributionProvider|eth_sendUserOperation|sendAttributedCalls|sendCalls|sendUserOperation|wallet_getCapabilities|wallet_sendCalls|useSendCalls|withUserOperationAttribution)\b/.test(
230348
+ if (/\b(?:createAttributionProvider|eth_sendUserOperation|sendAttributedCalls|sendCalls|sendUserOperation|wallet_getCapabilities|wallet_sendCalls|useSendCalls|withDataSuffixCapability|withUserOperationAttribution)\b/.test(
230304
230349
  source
230305
230350
  )) {
230306
230351
  frameworks.add("smart-wallet");
@@ -230395,7 +230440,7 @@ function classifyCall(marker, requestMethod, source, frameworks) {
230395
230440
  }
230396
230441
  return "viem";
230397
230442
  }
230398
- function evaluateCandidate(sourceFile, source, candidate, options) {
230443
+ function evaluateCandidate(sourceFile, source, candidate, fingerprintOccurrence, options) {
230399
230444
  const start = sourceFile.getLineAndCharacterOfPosition(candidate.node.getStart(sourceFile));
230400
230445
  const directSource = candidate.node.getText(sourceFile);
230401
230446
  const expectedSuffixes = options.builderCodes.map(
@@ -230403,8 +230448,12 @@ function evaluateCandidate(sourceFile, source, candidate, options) {
230403
230448
  );
230404
230449
  const directCodes = discoverBuilderCodes(directSource);
230405
230450
  const fileCodes = discoverBuilderCodes(source);
230406
- const hasExpectedDirectCode = directCodes.some((code) => options.builderCodes.includes(code));
230407
- const hasExpectedFileCode = fileCodes.some((code) => options.builderCodes.includes(code));
230451
+ const hasExpectedDirectCode = options.builderCodes.some(
230452
+ (code) => containsBuilderCode(directSource, code)
230453
+ );
230454
+ const hasExpectedFileCode = options.builderCodes.some(
230455
+ (code) => containsBuilderCode(source, code)
230456
+ );
230408
230457
  const hasExpectedSuffix = expectedSuffixes.some(
230409
230458
  (suffix) => source.toLowerCase().includes(suffix)
230410
230459
  );
@@ -230438,9 +230487,15 @@ function evaluateCandidate(sourceFile, source, candidate, options) {
230438
230487
  status = "protected";
230439
230488
  message = `${candidate.marker} is protected by Builder Code attribution.`;
230440
230489
  confidence = hasExpectedDirectCode ? "high" : "medium";
230441
- } else if (projectEvidence?.expected) {
230490
+ } else if (projectEvidence?.expected && candidate.family === "privy") {
230442
230491
  status = "protected";
230443
- message = `${candidate.marker} is covered by project-level Builder Code configuration.`;
230492
+ message = `${candidate.marker} is covered by the project-level Privy dataSuffix plugin.`;
230493
+ confidence = "medium";
230494
+ } else if (projectEvidence?.expected) {
230495
+ status = "unresolved";
230496
+ ruleId = "BAO004";
230497
+ message = `${candidate.marker} has project-level Builder Code configuration, but this call site is not statically linked to it.`;
230498
+ suggestion = "Pass dataSuffix at this call site or expose an import path the scanner can verify.";
230444
230499
  confidence = "medium";
230445
230500
  } else if (localAttribution || projectEvidence?.dynamic) {
230446
230501
  status = "unresolved";
@@ -230454,13 +230509,14 @@ function evaluateCandidate(sourceFile, source, candidate, options) {
230454
230509
  message = missingMessage(candidate);
230455
230510
  suggestion = suggestionFor(candidate.family);
230456
230511
  }
230457
- const severity = severityFor(status, options.profile, options.rules);
230512
+ const severity = severityFor(status, ruleId, options.profile, options.rules);
230458
230513
  const fingerprint = createFingerprint(
230459
230514
  ruleId ?? "protected",
230460
230515
  options.relativePath,
230461
230516
  candidate.family,
230462
230517
  candidate.marker,
230463
- start.line + 1
230518
+ normalizeFingerprintSource(directSource),
230519
+ fingerprintOccurrence
230464
230520
  );
230465
230521
  const isBaseline = options.baseline?.has(fingerprint) ?? false;
230466
230522
  return {
@@ -230482,7 +230538,7 @@ function evaluateCandidate(sourceFile, source, candidate, options) {
230482
230538
  }
230483
230539
  function findLocalAttribution(candidate, directSource, source) {
230484
230540
  if (candidate.family === "x402") {
230485
- const hasClientExtension = candidate.marker === "x402Client" && /\bregisterExtension\s*\([\s\S]*\bBuilderCodeClientExtension\b/.test(source);
230541
+ const hasClientExtension = (candidate.marker === "x402Client" || candidate.marker === "wrapFetchWithPayment") && /\bregisterExtension\s*\([\s\S]*\bBuilderCodeClientExtension\b/.test(source);
230486
230542
  const hasSellerExtension = candidate.marker === "paymentMiddleware" && /\bdeclareBuilderCodeExtension\s*\(/.test(source);
230487
230543
  if (hasClientExtension || hasSellerExtension) {
230488
230544
  return { kind: "helper", detail: "official x402 Builder Code extension" };
@@ -230490,9 +230546,9 @@ function findLocalAttribution(candidate, directSource, source) {
230490
230546
  return void 0;
230491
230547
  }
230492
230548
  if (candidate.family === "wallet") {
230493
- if (/\b(?:attributeUserOperation|sendAttributedCalls|withUserOperationAttribution)\b/.test(
230549
+ if (/\b(?:attributeUserOperation|sendAttributedCalls|withDataSuffixCapability|withUserOperationAttribution)\b/.test(
230494
230550
  directSource
230495
- ) || /\b(?:attributeUserOperation|createAttributionProvider|withUserOperationAttribution)\b/.test(
230551
+ ) || /\b(?:attributeUserOperation|createAttributionProvider|withDataSuffixCapability|withUserOperationAttribution)\b/.test(
230496
230552
  source
230497
230553
  )) {
230498
230554
  return { kind: "helper", detail: "Smart Wallet Attribution Kit middleware" };
@@ -230519,11 +230575,10 @@ function collectProjectEvidence(records, builderCodes) {
230519
230575
  if (!hasProjectConfigEvidence(record.source)) {
230520
230576
  continue;
230521
230577
  }
230522
- const codes = discoverBuilderCodes(record.source);
230523
- const expected = codes.some((code) => builderCodes.includes(code));
230578
+ const expected = builderCodes.some((code) => containsBuilderCode(record.source, code));
230524
230579
  const location = locationOf(
230525
230580
  record.source,
230526
- /\bdataSuffix\b|attributeUserOperation|BuilderCodeClientExtension|createAttributionProvider|declareBuilderCodeExtension|withUserOperationAttribution/
230581
+ /\bdataSuffix\b|attributeUserOperation|BuilderCodeClientExtension|createAttributionProvider|declareBuilderCodeExtension|withDataSuffixCapability|withUserOperationAttribution/
230527
230582
  );
230528
230583
  const families = evidenceFamilies(record);
230529
230584
  for (const family of families) {
@@ -230558,7 +230613,9 @@ function evidenceFamilies(record) {
230558
230613
  return Array.from(families);
230559
230614
  }
230560
230615
  function hasProjectConfigEvidence(source) {
230561
- return /\b(?:createWalletClient|createConfig)\b[\s\S]*\bdataSuffix\b/.test(source) || /\bplugins\s*:[\s\S]*\bdataSuffix\s*\(/.test(source) || /\bcreateAttributionProvider\s*\(/.test(source) || /\b(?:attributeUserOperation|withUserOperationAttribution)\s*\(/.test(source) || /\bwallet_getCapabilities\b/.test(source) && /\bcapabilities\b[\s\S]*\bdataSuffix\b/.test(source) || /\bregisterExtension\s*\([\s\S]*\bBuilderCodeClientExtension\b/.test(source) || /\bdeclareBuilderCodeExtension\s*\(/.test(source) || /\bcreateAttributionSigner\s*\(/.test(source);
230616
+ return /\b(?:createWalletClient|createConfig)\b[\s\S]*\bdataSuffix\b/.test(source) || /\bplugins\s*:[\s\S]*\bdataSuffix\s*\(/.test(source) || /\bcreateAttributionProvider\s*\(/.test(source) || /\b(?:attributeUserOperation|withDataSuffixCapability|withUserOperationAttribution)\s*\(/.test(
230617
+ source
230618
+ ) || /\bwallet_getCapabilities\b/.test(source) && /\bcapabilities\b[\s\S]*\bdataSuffix\b/.test(source) || /\bregisterExtension\s*\([\s\S]*\bBuilderCodeClientExtension\b/.test(source) || /\bdeclareBuilderCodeExtension\s*\(/.test(source) || /\bcreateAttributionSigner\s*\(/.test(source);
230562
230619
  }
230563
230620
  function missingRuleFor(family) {
230564
230621
  if (family === "wallet") return "BAO005";
@@ -230588,9 +230645,9 @@ function suggestionFor(family) {
230588
230645
  return "Add a BAO SDK helper or dataSuffix configuration to this transaction path.";
230589
230646
  }
230590
230647
  }
230591
- function severityFor(status, profile, rules) {
230648
+ function severityFor(status, ruleId, profile, rules) {
230592
230649
  if (status === "protected") return "off";
230593
- const configured = status === "missing" ? rules?.["missing-attribution"] : status === "wrong-code" ? rules?.["wrong-builder-code"] : rules?.["dynamic-attribution"];
230650
+ const configured = ruleId === "BAO004" ? rules?.["ambiguous-path"] : status === "missing" ? rules?.["missing-attribution"] : status === "wrong-code" ? rules?.["wrong-builder-code"] : rules?.["dynamic-attribution"];
230594
230651
  if (configured) return configured;
230595
230652
  if (profile === "local") return "warning";
230596
230653
  if (profile === "strict") return "error";
@@ -230659,8 +230716,23 @@ function pathRuleMatches(file, rule) {
230659
230716
  if (!normalized.includes("*")) {
230660
230717
  return file === normalized || file.startsWith(`${normalized}/`);
230661
230718
  }
230662
- const escaped = normalized.replace(/[.+^${}()|[\]\\]/g, "\\$&");
230663
- const pattern = escaped.replaceAll("**", "::DOUBLE::").replaceAll("*", "[^/]*").replaceAll("::DOUBLE::", ".*");
230719
+ let pattern = "";
230720
+ for (let index = 0; index < normalized.length; index += 1) {
230721
+ const character = normalized[index];
230722
+ const next = normalized[index + 1];
230723
+ const afterNext = normalized[index + 2];
230724
+ if (character === "*" && next === "*" && afterNext === "/") {
230725
+ pattern += "(?:.*/)?";
230726
+ index += 2;
230727
+ } else if (character === "*" && next === "*") {
230728
+ pattern += ".*";
230729
+ index += 1;
230730
+ } else if (character === "*") {
230731
+ pattern += "[^/]*";
230732
+ } else {
230733
+ pattern += character.replace(/[.+^${}()|[\]\\]/g, "\\$&");
230734
+ }
230735
+ }
230664
230736
  return new RegExp(`^${pattern}$`).test(file);
230665
230737
  }
230666
230738
  function readRequestMethod(node) {
@@ -230684,6 +230756,16 @@ function propertyName(name) {
230684
230756
  function discoverBuilderCodes(source) {
230685
230757
  return Array.from(new Set(source.match(BUILDER_CODE_REGEX) ?? []));
230686
230758
  }
230759
+ function containsBuilderCode(source, code) {
230760
+ return source.includes(`"${code}"`) || source.includes(`'${code}'`) || source.includes(`\`${code}\``);
230761
+ }
230762
+ function assertBuilderCodes(codes) {
230763
+ const errors = validateBuilderCodes(codes);
230764
+ if (errors.length > 0) throw new Error(errors.join("; "));
230765
+ }
230766
+ function normalizeFingerprintSource(source) {
230767
+ return source.replace(/\s+/g, " ").trim();
230768
+ }
230687
230769
  function confidenceFor(family, frameworks) {
230688
230770
  if (family === "viem" && !frameworks.includes("viem")) return "low";
230689
230771
  return "high";
@@ -230719,15 +230801,84 @@ async function loadBaoConfig(root, configPath = DEFAULT_CONFIG_FILE) {
230719
230801
  if (source === void 0) {
230720
230802
  return void 0;
230721
230803
  }
230722
- const parsed = JSON.parse(source);
230723
- if (!Array.isArray(parsed.builderCodes) || parsed.builderCodes.length === 0) {
230724
- throw new Error(`${import_path3.default.basename(resolved)} must define at least one builderCodes entry.`);
230804
+ const fileName = import_path3.default.basename(resolved);
230805
+ let parsed;
230806
+ try {
230807
+ parsed = JSON.parse(source);
230808
+ } catch (error2) {
230809
+ throw new Error(
230810
+ `${fileName} is not valid JSON: ${error2 instanceof Error ? error2.message : error2}`
230811
+ );
230725
230812
  }
230813
+ assertBaoConfig(parsed, fileName);
230726
230814
  return {
230727
230815
  config: parsed,
230728
230816
  path: resolved
230729
230817
  };
230730
230818
  }
230819
+ function assertBaoConfig(value, fileName) {
230820
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
230821
+ throw new Error(`${fileName} must contain a JSON object.`);
230822
+ }
230823
+ const config = value;
230824
+ const allowed = /* @__PURE__ */ new Set([
230825
+ "$schema",
230826
+ "builderCodes",
230827
+ "profile",
230828
+ "include",
230829
+ "exclude",
230830
+ "rules",
230831
+ "baseline"
230832
+ ]);
230833
+ const unknownKeys = Object.keys(config).filter((key) => !allowed.has(key));
230834
+ if (unknownKeys.length > 0) {
230835
+ throw new Error(`${fileName} contains unsupported field(s): ${unknownKeys.join(", ")}.`);
230836
+ }
230837
+ if (!Array.isArray(config.builderCodes) || !config.builderCodes.every(isString)) {
230838
+ throw new Error(`${fileName} must define builderCodes as a non-empty string array.`);
230839
+ }
230840
+ const codeErrors = validateBuilderCodes(config.builderCodes);
230841
+ if (codeErrors.length > 0) throw new Error(`${fileName}: ${codeErrors.join("; ")}`);
230842
+ if (config.$schema !== void 0 && typeof config.$schema !== "string") {
230843
+ throw new Error(`${fileName}.$schema must be a string.`);
230844
+ }
230845
+ if (config.profile !== void 0 && (typeof config.profile !== "string" || !SCAN_PROFILES.some((profile) => profile === config.profile))) {
230846
+ throw new Error(`${fileName}.profile must be local, ci, or strict.`);
230847
+ }
230848
+ assertOptionalStringArray(config.include, `${fileName}.include`);
230849
+ assertOptionalStringArray(config.exclude, `${fileName}.exclude`);
230850
+ if (config.baseline !== void 0 && typeof config.baseline !== "string") {
230851
+ throw new Error(`${fileName}.baseline must be a string.`);
230852
+ }
230853
+ assertRules(config.rules, fileName);
230854
+ }
230855
+ function assertOptionalStringArray(value, field) {
230856
+ if (value !== void 0 && (!Array.isArray(value) || !value.every(isString))) {
230857
+ throw new Error(`${field} must be an array of strings.`);
230858
+ }
230859
+ }
230860
+ function assertRules(value, fileName) {
230861
+ if (value === void 0) return;
230862
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
230863
+ throw new Error(`${fileName}.rules must be an object.`);
230864
+ }
230865
+ const allowedRules = /* @__PURE__ */ new Set([
230866
+ "missing-attribution",
230867
+ "wrong-builder-code",
230868
+ "dynamic-attribution",
230869
+ "ambiguous-path"
230870
+ ]);
230871
+ for (const [rule, severity] of Object.entries(value)) {
230872
+ if (!allowedRules.has(rule))
230873
+ throw new Error(`${fileName}.rules contains unsupported rule ${rule}.`);
230874
+ if (!["error", "warning", "off"].includes(String(severity))) {
230875
+ throw new Error(`${fileName}.rules.${rule} must be error, warning, or off.`);
230876
+ }
230877
+ }
230878
+ }
230879
+ function isString(value) {
230880
+ return typeof value === "string";
230881
+ }
230731
230882
  var RULES = {
230732
230883
  BAO001: {
230733
230884
  name: "missing-attribution",
@@ -230743,7 +230894,7 @@ var RULES = {
230743
230894
  },
230744
230895
  BAO004: {
230745
230896
  name: "ambiguous-path",
230746
- description: "A transaction path could not be classified with high confidence."
230897
+ description: "Project-level attribution evidence cannot be linked to a transaction path with high confidence."
230747
230898
  },
230748
230899
  BAO005: {
230749
230900
  name: "smart-wallet-data-suffix",
@@ -230756,7 +230907,7 @@ var RULES = {
230756
230907
  };
230757
230908
  function reportToSarif(report) {
230758
230909
  const findings = report.transactionPaths.filter(
230759
- (entry) => entry.status !== "protected" && entry.ruleId !== void 0 && !entry.baseline
230910
+ (entry) => entry.status !== "protected" && entry.ruleId !== void 0 && entry.severity !== "off" && !entry.baseline
230760
230911
  );
230761
230912
  return {
230762
230913
  version: "2.1.0",
@@ -230798,6 +230949,14 @@ function reportToSarif(report) {
230798
230949
  };
230799
230950
  }
230800
230951
 
230952
+ // src/options.ts
230953
+ function resolveActionProfile(input, configProfile) {
230954
+ return input.trim() || configProfile || "ci";
230955
+ }
230956
+ function resolveFailOnMissing(input) {
230957
+ return input.trim().length === 0 || input.trim().toLowerCase() !== "false";
230958
+ }
230959
+
230801
230960
  // src/index.ts
230802
230961
  async function main() {
230803
230962
  const repoPath = import_node_path.default.resolve(getInput("path") || ".");
@@ -230809,7 +230968,7 @@ async function main() {
230809
230968
  throw new Error("Set builder-code or commit a bao.config.json file.");
230810
230969
  }
230811
230970
  const paths = splitInput(getInput("paths"));
230812
- const profile = getInput("profile") || config?.profile || "ci";
230971
+ const profile = resolveActionProfile(getInput("profile"), config?.profile);
230813
230972
  const changedOnly = getBooleanInput("changed-only");
230814
230973
  const changedSince = changedOnly ? resolveBaseRef() : void 0;
230815
230974
  const baseline = getInput("baseline") || config?.baseline;
@@ -230827,8 +230986,7 @@ async function main() {
230827
230986
  await writeSummary(report, changedSince);
230828
230987
  await writeSarif(repoPath, report);
230829
230988
  setOutputs(report);
230830
- const failOnMissingInput = getInput("fail-on-missing");
230831
- const failOnMissing = failOnMissingInput.length === 0 ? true : failOnMissingInput.toLowerCase() !== "false";
230989
+ const failOnMissing = resolveFailOnMissing(getInput("fail-on-missing"));
230832
230990
  if (!report.ok && failOnMissing) {
230833
230991
  setFailed(`Base attribution validation failed with ${report.summary.errors} error(s).`);
230834
230992
  }
@@ -230926,12 +231084,12 @@ typescript/lib/typescript.js:
230926
231084
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
230927
231085
  this file except in compliance with the License. You may obtain a copy of the
230928
231086
  License at http://www.apache.org/licenses/LICENSE-2.0
230929
-
231087
+
230930
231088
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
230931
231089
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
230932
231090
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
230933
231091
  MERCHANTABLITY OR NON-INFRINGEMENT.
230934
-
231092
+
230935
231093
  See the Apache Version 2.0 License for specific language governing permissions
230936
231094
  and limitations under the License.
230937
231095
  ***************************************************************************** *)
package/package.json CHANGED
@@ -1,21 +1,34 @@
1
1
  {
2
2
  "name": "@base-attribution-os/github-action",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "GitHub Action wrapper for Base Attribution OS repo scans.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
+ "engines": {
8
+ "node": ">=20.11"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/horn111/base-attribution-os.git",
13
+ "directory": "packages/github-action"
14
+ },
15
+ "homepage": "https://github.com/horn111/base-attribution-os#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/horn111/base-attribution-os/issues"
18
+ },
7
19
  "publishConfig": {
8
20
  "access": "public"
9
21
  },
10
22
  "files": [
11
23
  "action.yml",
12
- "dist"
24
+ "dist",
25
+ "README.md"
13
26
  ],
14
27
  "main": "./dist/index.cjs",
15
28
  "dependencies": {
16
29
  "@actions/core": "^3.0.1",
17
- "@base-attribution-os/cli": "0.2.0",
18
- "@base-attribution-os/scanner": "0.2.0"
30
+ "@base-attribution-os/cli": "0.2.1",
31
+ "@base-attribution-os/scanner": "0.3.0"
19
32
  },
20
33
  "scripts": {
21
34
  "build": "tsup",