raindrop-ai 1.0.3 → 1.0.4

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.
@@ -36,7 +36,7 @@ import {
36
36
  withReplayTraceDestination,
37
37
  withRoutingContext,
38
38
  withTask
39
- } from "./chunk-TA34XFER.mjs";
39
+ } from "./chunk-X63NB5YG.mjs";
40
40
  import {
41
41
  CapturedTraceSnapshotSchema,
42
42
  EvalCaseExpectationSchema,
@@ -5569,27 +5569,38 @@ var require_NameRedactor = __commonJS({
5569
5569
  Object.defineProperty(exports, "__esModule", { value: true });
5570
5570
  exports.NameRedactor = void 0;
5571
5571
  var greetingRegex = /(^|\.\s+)(dear|hi|hello|greetings|hey|hey there)/gi;
5572
- var closingRegex = /(thx|thanks|thank you|regards|best|[a-z]+ly|[a-z]+ regards|all the best|happy [a-z]+ing|take care|have a [a-z]+ (weekend|night|day))/gi;
5572
+ var closingRegex = /(thx|thanks|thank you|regards|best|[a-z]{1,30}ly|[a-z]{1,30} regards|all the best|happy [a-z]{1,30}ing|take care|have a [a-z]{1,30} (weekend|night|day))/gi;
5573
5573
  var greetingOrClosing = new RegExp("(((" + greetingRegex.source + ")|(" + closingRegex.source + "\\s*[,.!]*))[\\s-]*)", "gi");
5574
- var genericName = new RegExp("( ?(([A-Z][a-z]+)|([A-Z]\\.)))+([,.]|[,.]?$)", "gm");
5574
+ var genericName = new RegExp("( ?(([A-Z][a-z]{1,30})|([A-Z]\\.))){1,10}([,.]|[,.]?$)", "my");
5575
5575
  var NameRedactor = class {
5576
5576
  constructor(replaceWith = "PERSON_NAME") {
5577
5577
  this.replaceWith = replaceWith;
5578
5578
  }
5579
5579
  redact(textToRedact) {
5580
+ var _a;
5580
5581
  greetingOrClosing.lastIndex = 0;
5581
5582
  genericName.lastIndex = 0;
5583
+ const pieces = [];
5584
+ let copiedThrough = 0;
5585
+ let changed = false;
5582
5586
  let greetingOrClosingMatch = greetingOrClosing.exec(textToRedact);
5583
5587
  while (greetingOrClosingMatch !== null) {
5584
5588
  genericName.lastIndex = greetingOrClosing.lastIndex;
5585
- let genericNameMatch = genericName.exec(textToRedact);
5589
+ const genericNameMatch = genericName.exec(textToRedact);
5586
5590
  if (genericNameMatch !== null && genericNameMatch.index === greetingOrClosing.lastIndex) {
5587
- let suffix = genericNameMatch[5] === null ? "" : genericNameMatch[5];
5588
- textToRedact = textToRedact.slice(0, genericNameMatch.index) + this.replaceWith + suffix + textToRedact.slice(genericNameMatch.index + genericNameMatch[0].length);
5591
+ const suffix = (_a = genericNameMatch[5]) !== null && _a !== void 0 ? _a : "";
5592
+ const end = genericNameMatch.index + genericNameMatch[0].length;
5593
+ pieces.push(textToRedact.slice(copiedThrough, genericNameMatch.index), this.replaceWith, suffix);
5594
+ copiedThrough = end;
5595
+ changed = true;
5596
+ greetingOrClosing.lastIndex = end - suffix.length;
5589
5597
  }
5590
5598
  greetingOrClosingMatch = greetingOrClosing.exec(textToRedact);
5591
5599
  }
5592
- return textToRedact;
5600
+ if (!changed)
5601
+ return textToRedact;
5602
+ pieces.push(textToRedact.slice(copiedThrough));
5603
+ return pieces.join("");
5593
5604
  }
5594
5605
  };
5595
5606
  exports.NameRedactor = NameRedactor;
@@ -5606,17 +5617,17 @@ var require_simple_regexp_patterns = __commonJS({
5606
5617
  var poBoxRegex = /P\.? ?O\.? *Box +\d+/gi;
5607
5618
  var roadRegex = /(street|st|road|rd|avenue|ave|drive|dr|loop|court|ct|circle|cir|lane|ln|boulevard|blvd|way)\.?\b/gi;
5608
5619
  exports.creditCardNumber = /\d{4}[ -]?\d{4}[ -]?\d{4}[ -]?\d{4}|\d{4}[ -]?\d{6}[ -]?\d{4}\d?/g;
5609
- exports.streetAddress = new RegExp("(\\d+\\s*(\\w+ ){1,2}" + roadRegex.source + "(\\s+" + aptRegex.source + ")?)|(" + poBoxRegex.source + ")", "gi");
5620
+ exports.streetAddress = new RegExp("(\\d{1,10}\\s*(\\w{1,30} ){1,2}" + roadRegex.source + "(\\s+" + aptRegex.source + ")?)|(" + poBoxRegex.source + ")", "gi");
5610
5621
  exports.zipcode = /\b\d{5}\b(-\d{4})?\b/g;
5611
5622
  exports.phoneNumber = /(\(?\+?[0-9]{1,2}\)?[-. ]?)?(\(?[0-9]{3}\)?|[0-9]{3})[-. ]?([0-9]{3}[-. ]?[0-9]{4}|\b[A-Z0-9]{7}\b)/g;
5612
5623
  exports.ipAddress = /(\d{1,3}(\.\d{1,3}){3}|[0-9A-F]{4}(:[0-9A-F]{4}){5}(::|(:0000)+))/gi;
5613
5624
  exports.usSocialSecurityNumber = /\b\d{3}[ -.]\d{2}[ -.]\d{4}\b/g;
5614
- exports.emailAddress = /([a-z0-9_\-.+]+)@\w+(\.\w+)*/gi;
5625
+ exports.emailAddress = /([a-z0-9_\-.+]{1,64})@\w+(\.\w+)*/gi;
5615
5626
  exports.username = /(user( ?name)?|login): \S+/gi;
5616
5627
  exports.password = /(pass(word|phrase)?|secret): \S+/gi;
5617
5628
  exports.credentials = /(login( cred(ential)?s| info(rmation)?)?|cred(ential)?s) ?:\s*\S+\s+\/?\s*\S+/gi;
5618
5629
  exports.digits = /\b\d{4,}\b/g;
5619
- exports.url = /([^\s:/?#]+):\/\/([^/?#\s]*)([^?#\s]*)(\?([^#\s]*))?(#([^\s]*))?/g;
5630
+ exports.url = /([^\s:/?#]{1,64}):\/\/([^/?#\s]*)([^?#\s]*)(\?([^#\s]*))?(#([^\s]*))?/g;
5620
5631
  }
5621
5632
  });
5622
5633
 
@@ -1784,7 +1784,7 @@ installTracingSuppressionHook();
1784
1784
  // package.json
1785
1785
  var package_default = {
1786
1786
  name: "raindrop-ai",
1787
- version: "1.0.3",
1787
+ version: "1.0.4",
1788
1788
  main: "dist/index.js",
1789
1789
  module: "dist/index.mjs",
1790
1790
  types: "dist/index.d.ts",
package/dist/evals/cli.js CHANGED
@@ -5535,27 +5535,38 @@ var require_NameRedactor = __commonJS({
5535
5535
  Object.defineProperty(exports2, "__esModule", { value: true });
5536
5536
  exports2.NameRedactor = void 0;
5537
5537
  var greetingRegex = /(^|\.\s+)(dear|hi|hello|greetings|hey|hey there)/gi;
5538
- var closingRegex = /(thx|thanks|thank you|regards|best|[a-z]+ly|[a-z]+ regards|all the best|happy [a-z]+ing|take care|have a [a-z]+ (weekend|night|day))/gi;
5538
+ var closingRegex = /(thx|thanks|thank you|regards|best|[a-z]{1,30}ly|[a-z]{1,30} regards|all the best|happy [a-z]{1,30}ing|take care|have a [a-z]{1,30} (weekend|night|day))/gi;
5539
5539
  var greetingOrClosing = new RegExp("(((" + greetingRegex.source + ")|(" + closingRegex.source + "\\s*[,.!]*))[\\s-]*)", "gi");
5540
- var genericName = new RegExp("( ?(([A-Z][a-z]+)|([A-Z]\\.)))+([,.]|[,.]?$)", "gm");
5540
+ var genericName = new RegExp("( ?(([A-Z][a-z]{1,30})|([A-Z]\\.))){1,10}([,.]|[,.]?$)", "my");
5541
5541
  var NameRedactor = class {
5542
5542
  constructor(replaceWith = "PERSON_NAME") {
5543
5543
  this.replaceWith = replaceWith;
5544
5544
  }
5545
5545
  redact(textToRedact) {
5546
+ var _a;
5546
5547
  greetingOrClosing.lastIndex = 0;
5547
5548
  genericName.lastIndex = 0;
5549
+ const pieces = [];
5550
+ let copiedThrough = 0;
5551
+ let changed = false;
5548
5552
  let greetingOrClosingMatch = greetingOrClosing.exec(textToRedact);
5549
5553
  while (greetingOrClosingMatch !== null) {
5550
5554
  genericName.lastIndex = greetingOrClosing.lastIndex;
5551
- let genericNameMatch = genericName.exec(textToRedact);
5555
+ const genericNameMatch = genericName.exec(textToRedact);
5552
5556
  if (genericNameMatch !== null && genericNameMatch.index === greetingOrClosing.lastIndex) {
5553
- let suffix = genericNameMatch[5] === null ? "" : genericNameMatch[5];
5554
- textToRedact = textToRedact.slice(0, genericNameMatch.index) + this.replaceWith + suffix + textToRedact.slice(genericNameMatch.index + genericNameMatch[0].length);
5557
+ const suffix = (_a = genericNameMatch[5]) !== null && _a !== void 0 ? _a : "";
5558
+ const end = genericNameMatch.index + genericNameMatch[0].length;
5559
+ pieces.push(textToRedact.slice(copiedThrough, genericNameMatch.index), this.replaceWith, suffix);
5560
+ copiedThrough = end;
5561
+ changed = true;
5562
+ greetingOrClosing.lastIndex = end - suffix.length;
5555
5563
  }
5556
5564
  greetingOrClosingMatch = greetingOrClosing.exec(textToRedact);
5557
5565
  }
5558
- return textToRedact;
5566
+ if (!changed)
5567
+ return textToRedact;
5568
+ pieces.push(textToRedact.slice(copiedThrough));
5569
+ return pieces.join("");
5559
5570
  }
5560
5571
  };
5561
5572
  exports2.NameRedactor = NameRedactor;
@@ -5572,17 +5583,17 @@ var require_simple_regexp_patterns = __commonJS({
5572
5583
  var poBoxRegex = /P\.? ?O\.? *Box +\d+/gi;
5573
5584
  var roadRegex = /(street|st|road|rd|avenue|ave|drive|dr|loop|court|ct|circle|cir|lane|ln|boulevard|blvd|way)\.?\b/gi;
5574
5585
  exports2.creditCardNumber = /\d{4}[ -]?\d{4}[ -]?\d{4}[ -]?\d{4}|\d{4}[ -]?\d{6}[ -]?\d{4}\d?/g;
5575
- exports2.streetAddress = new RegExp("(\\d+\\s*(\\w+ ){1,2}" + roadRegex.source + "(\\s+" + aptRegex.source + ")?)|(" + poBoxRegex.source + ")", "gi");
5586
+ exports2.streetAddress = new RegExp("(\\d{1,10}\\s*(\\w{1,30} ){1,2}" + roadRegex.source + "(\\s+" + aptRegex.source + ")?)|(" + poBoxRegex.source + ")", "gi");
5576
5587
  exports2.zipcode = /\b\d{5}\b(-\d{4})?\b/g;
5577
5588
  exports2.phoneNumber = /(\(?\+?[0-9]{1,2}\)?[-. ]?)?(\(?[0-9]{3}\)?|[0-9]{3})[-. ]?([0-9]{3}[-. ]?[0-9]{4}|\b[A-Z0-9]{7}\b)/g;
5578
5589
  exports2.ipAddress = /(\d{1,3}(\.\d{1,3}){3}|[0-9A-F]{4}(:[0-9A-F]{4}){5}(::|(:0000)+))/gi;
5579
5590
  exports2.usSocialSecurityNumber = /\b\d{3}[ -.]\d{2}[ -.]\d{4}\b/g;
5580
- exports2.emailAddress = /([a-z0-9_\-.+]+)@\w+(\.\w+)*/gi;
5591
+ exports2.emailAddress = /([a-z0-9_\-.+]{1,64})@\w+(\.\w+)*/gi;
5581
5592
  exports2.username = /(user( ?name)?|login): \S+/gi;
5582
5593
  exports2.password = /(pass(word|phrase)?|secret): \S+/gi;
5583
5594
  exports2.credentials = /(login( cred(ential)?s| info(rmation)?)?|cred(ential)?s) ?:\s*\S+\s+\/?\s*\S+/gi;
5584
5595
  exports2.digits = /\b\d{4,}\b/g;
5585
- exports2.url = /([^\s:/?#]+):\/\/([^/?#\s]*)([^?#\s]*)(\?([^#\s]*))?(#([^\s]*))?/g;
5596
+ exports2.url = /([^\s:/?#]{1,64}):\/\/([^/?#\s]*)([^?#\s]*)(\?([^#\s]*))?(#([^\s]*))?/g;
5586
5597
  }
5587
5598
  });
5588
5599
 
@@ -12615,7 +12626,7 @@ var SignalEventSchema = external_exports.object({
12615
12626
  // package.json
12616
12627
  var package_default = {
12617
12628
  name: "raindrop-ai",
12618
- version: "1.0.3",
12629
+ version: "1.0.4",
12619
12630
  main: "dist/index.js",
12620
12631
  module: "dist/index.mjs",
12621
12632
  types: "dist/index.d.ts",
@@ -5,8 +5,8 @@ import {
5
5
  publishEvalSuite,
6
6
  readEvaluator,
7
7
  runEvalSuite
8
- } from "../chunk-DR7AZ3V6.mjs";
9
- import "../chunk-TA34XFER.mjs";
8
+ } from "../chunk-ODXCGK4U.mjs";
9
+ import "../chunk-X63NB5YG.mjs";
10
10
  import {
11
11
  isEvalSuiteDefinition
12
12
  } from "../chunk-OZMT7UW4.mjs";
package/dist/index.js CHANGED
@@ -5539,27 +5539,38 @@ var require_NameRedactor = __commonJS({
5539
5539
  Object.defineProperty(exports2, "__esModule", { value: true });
5540
5540
  exports2.NameRedactor = void 0;
5541
5541
  var greetingRegex = /(^|\.\s+)(dear|hi|hello|greetings|hey|hey there)/gi;
5542
- var closingRegex = /(thx|thanks|thank you|regards|best|[a-z]+ly|[a-z]+ regards|all the best|happy [a-z]+ing|take care|have a [a-z]+ (weekend|night|day))/gi;
5542
+ var closingRegex = /(thx|thanks|thank you|regards|best|[a-z]{1,30}ly|[a-z]{1,30} regards|all the best|happy [a-z]{1,30}ing|take care|have a [a-z]{1,30} (weekend|night|day))/gi;
5543
5543
  var greetingOrClosing = new RegExp("(((" + greetingRegex.source + ")|(" + closingRegex.source + "\\s*[,.!]*))[\\s-]*)", "gi");
5544
- var genericName = new RegExp("( ?(([A-Z][a-z]+)|([A-Z]\\.)))+([,.]|[,.]?$)", "gm");
5544
+ var genericName = new RegExp("( ?(([A-Z][a-z]{1,30})|([A-Z]\\.))){1,10}([,.]|[,.]?$)", "my");
5545
5545
  var NameRedactor = class {
5546
5546
  constructor(replaceWith = "PERSON_NAME") {
5547
5547
  this.replaceWith = replaceWith;
5548
5548
  }
5549
5549
  redact(textToRedact) {
5550
+ var _a;
5550
5551
  greetingOrClosing.lastIndex = 0;
5551
5552
  genericName.lastIndex = 0;
5553
+ const pieces = [];
5554
+ let copiedThrough = 0;
5555
+ let changed = false;
5552
5556
  let greetingOrClosingMatch = greetingOrClosing.exec(textToRedact);
5553
5557
  while (greetingOrClosingMatch !== null) {
5554
5558
  genericName.lastIndex = greetingOrClosing.lastIndex;
5555
- let genericNameMatch = genericName.exec(textToRedact);
5559
+ const genericNameMatch = genericName.exec(textToRedact);
5556
5560
  if (genericNameMatch !== null && genericNameMatch.index === greetingOrClosing.lastIndex) {
5557
- let suffix = genericNameMatch[5] === null ? "" : genericNameMatch[5];
5558
- textToRedact = textToRedact.slice(0, genericNameMatch.index) + this.replaceWith + suffix + textToRedact.slice(genericNameMatch.index + genericNameMatch[0].length);
5561
+ const suffix = (_a = genericNameMatch[5]) !== null && _a !== void 0 ? _a : "";
5562
+ const end = genericNameMatch.index + genericNameMatch[0].length;
5563
+ pieces.push(textToRedact.slice(copiedThrough, genericNameMatch.index), this.replaceWith, suffix);
5564
+ copiedThrough = end;
5565
+ changed = true;
5566
+ greetingOrClosing.lastIndex = end - suffix.length;
5559
5567
  }
5560
5568
  greetingOrClosingMatch = greetingOrClosing.exec(textToRedact);
5561
5569
  }
5562
- return textToRedact;
5570
+ if (!changed)
5571
+ return textToRedact;
5572
+ pieces.push(textToRedact.slice(copiedThrough));
5573
+ return pieces.join("");
5563
5574
  }
5564
5575
  };
5565
5576
  exports2.NameRedactor = NameRedactor;
@@ -5576,17 +5587,17 @@ var require_simple_regexp_patterns = __commonJS({
5576
5587
  var poBoxRegex = /P\.? ?O\.? *Box +\d+/gi;
5577
5588
  var roadRegex = /(street|st|road|rd|avenue|ave|drive|dr|loop|court|ct|circle|cir|lane|ln|boulevard|blvd|way)\.?\b/gi;
5578
5589
  exports2.creditCardNumber = /\d{4}[ -]?\d{4}[ -]?\d{4}[ -]?\d{4}|\d{4}[ -]?\d{6}[ -]?\d{4}\d?/g;
5579
- exports2.streetAddress = new RegExp("(\\d+\\s*(\\w+ ){1,2}" + roadRegex.source + "(\\s+" + aptRegex.source + ")?)|(" + poBoxRegex.source + ")", "gi");
5590
+ exports2.streetAddress = new RegExp("(\\d{1,10}\\s*(\\w{1,30} ){1,2}" + roadRegex.source + "(\\s+" + aptRegex.source + ")?)|(" + poBoxRegex.source + ")", "gi");
5580
5591
  exports2.zipcode = /\b\d{5}\b(-\d{4})?\b/g;
5581
5592
  exports2.phoneNumber = /(\(?\+?[0-9]{1,2}\)?[-. ]?)?(\(?[0-9]{3}\)?|[0-9]{3})[-. ]?([0-9]{3}[-. ]?[0-9]{4}|\b[A-Z0-9]{7}\b)/g;
5582
5593
  exports2.ipAddress = /(\d{1,3}(\.\d{1,3}){3}|[0-9A-F]{4}(:[0-9A-F]{4}){5}(::|(:0000)+))/gi;
5583
5594
  exports2.usSocialSecurityNumber = /\b\d{3}[ -.]\d{2}[ -.]\d{4}\b/g;
5584
- exports2.emailAddress = /([a-z0-9_\-.+]+)@\w+(\.\w+)*/gi;
5595
+ exports2.emailAddress = /([a-z0-9_\-.+]{1,64})@\w+(\.\w+)*/gi;
5585
5596
  exports2.username = /(user( ?name)?|login): \S+/gi;
5586
5597
  exports2.password = /(pass(word|phrase)?|secret): \S+/gi;
5587
5598
  exports2.credentials = /(login( cred(ential)?s| info(rmation)?)?|cred(ential)?s) ?:\s*\S+\s+\/?\s*\S+/gi;
5588
5599
  exports2.digits = /\b\d{4,}\b/g;
5589
- exports2.url = /([^\s:/?#]+):\/\/([^/?#\s]*)([^?#\s]*)(\?([^#\s]*))?(#([^\s]*))?/g;
5600
+ exports2.url = /([^\s:/?#]{1,64}):\/\/([^/?#\s]*)([^?#\s]*)(\?([^#\s]*))?(#([^\s]*))?/g;
5590
5601
  }
5591
5602
  });
5592
5603
 
@@ -13290,7 +13301,7 @@ var SignalEventSchema = external_exports.object({
13290
13301
  // package.json
13291
13302
  var package_default = {
13292
13303
  name: "raindrop-ai",
13293
- version: "1.0.3",
13304
+ version: "1.0.4",
13294
13305
  main: "dist/index.js",
13295
13306
  module: "dist/index.mjs",
13296
13307
  types: "dist/index.d.ts",
package/dist/index.mjs CHANGED
@@ -47,8 +47,8 @@ import {
47
47
  runReplay,
48
48
  traceTools,
49
49
  withEvalScope
50
- } from "./chunk-DR7AZ3V6.mjs";
51
- import "./chunk-TA34XFER.mjs";
50
+ } from "./chunk-ODXCGK4U.mjs";
51
+ import "./chunk-X63NB5YG.mjs";
52
52
  import {
53
53
  BooleanThresholdSchema,
54
54
  EvalContextSchema,
@@ -1594,7 +1594,7 @@ function base64ToHex2(base64) {
1594
1594
  // package.json
1595
1595
  var package_default = {
1596
1596
  name: "raindrop-ai",
1597
- version: "1.0.3",
1597
+ version: "1.0.4",
1598
1598
  main: "dist/index.js",
1599
1599
  module: "dist/index.mjs",
1600
1600
  types: "dist/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tracing
3
- } from "../chunk-TA34XFER.mjs";
3
+ } from "../chunk-X63NB5YG.mjs";
4
4
  import "../chunk-UJCSKKID.mjs";
5
5
 
6
6
  // src/tracing/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "raindrop-ai",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -49,8 +49,8 @@
49
49
  "vite": "^7.3.7",
50
50
  "vitest": "^4.1.12",
51
51
  "@raindrop-ai/core": "0.3.1",
52
- "@raindrop-ai/schemas": "0.1.0",
53
- "@raindrop-ai/redact-pii": "0.1.2"
52
+ "@raindrop-ai/redact-pii": "0.1.2",
53
+ "@raindrop-ai/schemas": "0.1.0"
54
54
  },
55
55
  "dependencies": {
56
56
  "@jitl/quickjs-singlefile-cjs-release-sync": "0.32.0",