@fangyb/ahchat-bridge 0.1.41 → 0.1.43

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.
@@ -31266,6 +31266,7 @@ function parseLogLevel(value, fallback = "INFO") {
31266
31266
 
31267
31267
  // ../logger/src/logger.ts
31268
31268
  var REDACTED = "***";
31269
+ var REDACTED_PATH = "[path]";
31269
31270
  var SENSITIVE_KEY_RE = /(token|apikey|authorization|password|secret|cookie)/i;
31270
31271
  function shouldRedactKey(key) {
31271
31272
  const normalized = key.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
@@ -31273,8 +31274,20 @@ function shouldRedactKey(key) {
31273
31274
  if (normalized.endsWith("hash")) return false;
31274
31275
  return SENSITIVE_KEY_RE.test(normalized);
31275
31276
  }
31277
+ function redactFilesystemPaths(value) {
31278
+ return value.replace(/\b[A-Za-z]:\\[^\s"'`<>|]+/g, REDACTED_PATH).replace(/\\\\[^\\\s"'`<>|]+\\[^\s"'`<>|]+/g, REDACTED_PATH).replace(
31279
+ /(^|[\s"'`(=])\/(?:home|Users)\/[^\s"'`<>]+/g,
31280
+ (_match, prefix) => `${prefix}${REDACTED_PATH}`
31281
+ );
31282
+ }
31276
31283
  function redactString(value) {
31277
- return value.replace(/([?&](?:token|api_?key|access_token|refresh_token)=)[^&#\s"']+/gi, `$1${REDACTED}`).replace(/("(?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)"\s*:\s*")[^"]*/gi, `$1${REDACTED}`).replace(/((?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)=)[^\s&"']+/gi, `$1${REDACTED}`).replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi, `$1${REDACTED}`).replace(/\bsk-[A-Za-z0-9._-]{6,}\b/g, "sk-***");
31284
+ return redactFilesystemPaths(value).replace(/([?&](?:token|api_?key|access_token|refresh_token)=)[^&#\s"']+/gi, `$1${REDACTED}`).replace(
31285
+ /("(?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)"\s*:\s*")[^"]*/gi,
31286
+ `$1${REDACTED}`
31287
+ ).replace(
31288
+ /((?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)=)[^\s&"']+/gi,
31289
+ `$1${REDACTED}`
31290
+ ).replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi, `$1${REDACTED}`).replace(/\bsk-[A-Za-z0-9._-]{6,}\b/g, "sk-***");
31278
31291
  }
31279
31292
  function serializeError(err) {
31280
31293
  if (err instanceof Error) {
@@ -31266,6 +31266,7 @@ function parseLogLevel(value, fallback = "INFO") {
31266
31266
 
31267
31267
  // ../logger/src/logger.ts
31268
31268
  var REDACTED = "***";
31269
+ var REDACTED_PATH = "[path]";
31269
31270
  var SENSITIVE_KEY_RE = /(token|apikey|authorization|password|secret|cookie)/i;
31270
31271
  function shouldRedactKey(key) {
31271
31272
  const normalized = key.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
@@ -31273,8 +31274,20 @@ function shouldRedactKey(key) {
31273
31274
  if (normalized.endsWith("hash")) return false;
31274
31275
  return SENSITIVE_KEY_RE.test(normalized);
31275
31276
  }
31277
+ function redactFilesystemPaths(value) {
31278
+ return value.replace(/\b[A-Za-z]:\\[^\s"'`<>|]+/g, REDACTED_PATH).replace(/\\\\[^\\\s"'`<>|]+\\[^\s"'`<>|]+/g, REDACTED_PATH).replace(
31279
+ /(^|[\s"'`(=])\/(?:home|Users)\/[^\s"'`<>]+/g,
31280
+ (_match, prefix) => `${prefix}${REDACTED_PATH}`
31281
+ );
31282
+ }
31276
31283
  function redactString(value) {
31277
- return value.replace(/([?&](?:token|api_?key|access_token|refresh_token)=)[^&#\s"']+/gi, `$1${REDACTED}`).replace(/("(?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)"\s*:\s*")[^"]*/gi, `$1${REDACTED}`).replace(/((?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)=)[^\s&"']+/gi, `$1${REDACTED}`).replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi, `$1${REDACTED}`).replace(/\bsk-[A-Za-z0-9._-]{6,}\b/g, "sk-***");
31284
+ return redactFilesystemPaths(value).replace(/([?&](?:token|api_?key|access_token|refresh_token)=)[^&#\s"']+/gi, `$1${REDACTED}`).replace(
31285
+ /("(?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)"\s*:\s*")[^"]*/gi,
31286
+ `$1${REDACTED}`
31287
+ ).replace(
31288
+ /((?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)=)[^\s&"']+/gi,
31289
+ `$1${REDACTED}`
31290
+ ).replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi, `$1${REDACTED}`).replace(/\bsk-[A-Za-z0-9._-]{6,}\b/g, "sk-***");
31278
31291
  }
31279
31292
  function serializeError(err) {
31280
31293
  if (err instanceof Error) {
@@ -31264,6 +31264,7 @@ function parseLogLevel(value, fallback = "INFO") {
31264
31264
 
31265
31265
  // ../logger/src/logger.ts
31266
31266
  var REDACTED = "***";
31267
+ var REDACTED_PATH = "[path]";
31267
31268
  var SENSITIVE_KEY_RE = /(token|apikey|authorization|password|secret|cookie)/i;
31268
31269
  function shouldRedactKey(key) {
31269
31270
  const normalized = key.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
@@ -31271,8 +31272,20 @@ function shouldRedactKey(key) {
31271
31272
  if (normalized.endsWith("hash")) return false;
31272
31273
  return SENSITIVE_KEY_RE.test(normalized);
31273
31274
  }
31275
+ function redactFilesystemPaths(value) {
31276
+ return value.replace(/\b[A-Za-z]:\\[^\s"'`<>|]+/g, REDACTED_PATH).replace(/\\\\[^\\\s"'`<>|]+\\[^\s"'`<>|]+/g, REDACTED_PATH).replace(
31277
+ /(^|[\s"'`(=])\/(?:home|Users)\/[^\s"'`<>]+/g,
31278
+ (_match, prefix) => `${prefix}${REDACTED_PATH}`
31279
+ );
31280
+ }
31274
31281
  function redactString(value) {
31275
- return value.replace(/([?&](?:token|api_?key|access_token|refresh_token)=)[^&#\s"']+/gi, `$1${REDACTED}`).replace(/("(?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)"\s*:\s*")[^"]*/gi, `$1${REDACTED}`).replace(/((?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)=)[^\s&"']+/gi, `$1${REDACTED}`).replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi, `$1${REDACTED}`).replace(/\bsk-[A-Za-z0-9._-]{6,}\b/g, "sk-***");
31282
+ return redactFilesystemPaths(value).replace(/([?&](?:token|api_?key|access_token|refresh_token)=)[^&#\s"']+/gi, `$1${REDACTED}`).replace(
31283
+ /("(?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)"\s*:\s*")[^"]*/gi,
31284
+ `$1${REDACTED}`
31285
+ ).replace(
31286
+ /((?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)=)[^\s&"']+/gi,
31287
+ `$1${REDACTED}`
31288
+ ).replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi, `$1${REDACTED}`).replace(/\bsk-[A-Za-z0-9._-]{6,}\b/g, "sk-***");
31276
31289
  }
31277
31290
  function serializeError(err) {
31278
31291
  if (err instanceof Error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fangyb/ahchat-bridge",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
4
4
  "files": [
5
5
  "dist"
6
6
  ],