@rasputin-ai/browser 0.7.1 → 0.7.2-beta.1

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 CHANGED
@@ -1,5 +1,5 @@
1
- # Official Rasputin AI SDK for browsers
2
-
3
- Report frontend errors to Rasputin from Vite apps.
4
-
5
- See the [browser documentation](https://rasputinai.dev/docs/browser/installation).
1
+ # Official Rasputin AI SDK for browsers
2
+
3
+ Report frontend errors to Rasputin from Vite apps.
4
+
5
+ See the [browser documentation](https://rasputinai.dev/docs/browser/installation).
package/dist/index.js CHANGED
@@ -3444,7 +3444,7 @@ var mapBrowserRuntimeState = (snapshot, buildId) => {
3444
3444
 
3445
3445
  // src/sdk-meta.ts
3446
3446
  var SDK_NAME = "@rasputin-ai/browser";
3447
- var SDK_VERSION = "0.7.1";
3447
+ var SDK_VERSION = "0.7.2-beta.1";
3448
3448
 
3449
3449
  // src/rasputin-init.ts
3450
3450
  var DEFAULT_API_URL = "https://api.rasputinai.dev";
@@ -1,4 +1,4 @@
1
1
  /** Generated by scripts/generate-sdk-meta.ts — do not edit. */
2
2
  export declare const SDK_NAME = "@rasputin-ai/browser";
3
- export declare const SDK_VERSION = "0.7.1";
3
+ export declare const SDK_VERSION = "0.7.2-beta.1";
4
4
  //# sourceMappingURL=sdk-meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-meta.d.ts","sourceRoot":"","sources":["../src/sdk-meta.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,yBAAyB,CAAC;AAC/C,eAAO,MAAM,WAAW,UAAU,CAAC"}
1
+ {"version":3,"file":"sdk-meta.d.ts","sourceRoot":"","sources":["../src/sdk-meta.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,yBAAyB,CAAC;AAC/C,eAAO,MAAM,WAAW,iBAAiB,CAAC"}
@@ -10,6 +10,168 @@ var compactRuntimeFunctionId = (moduleIndex, planIndex) => `${moduleIndex}.${pla
10
10
  // ../core/src/create-ingest-event/truncate-ingest-message.ts
11
11
  var MAX_MESSAGE_BYTES = 8 * 1024;
12
12
 
13
+ // ../core/src/derivation/sensitive-property-name.ts
14
+ var DEFAULT_SENSITIVE_PROPERTY_NAMES = [
15
+ "password",
16
+ "passwd",
17
+ "pwd",
18
+ "passphrase",
19
+ "token",
20
+ "accesstoken",
21
+ "refreshtoken",
22
+ "sessiontoken",
23
+ "authorization",
24
+ "auth",
25
+ "bearer",
26
+ "cookie",
27
+ "cookies",
28
+ "signedcookies",
29
+ "setcookie",
30
+ "secret",
31
+ "secrets",
32
+ "clientsecret",
33
+ "apikey",
34
+ "xapikey",
35
+ "credential",
36
+ "credentials",
37
+ "privatekey",
38
+ "privkey",
39
+ "pem",
40
+ "jwt",
41
+ "otp",
42
+ "totp",
43
+ "pin",
44
+ "mfacode",
45
+ "sessionid",
46
+ "sid",
47
+ "databaseurl",
48
+ "connectionstring",
49
+ "dsn",
50
+ "mongouri",
51
+ "redisurl",
52
+ "signingkey",
53
+ "encryptionkey",
54
+ "cvv",
55
+ "cvc",
56
+ "cardnumber",
57
+ "ssn",
58
+ "creditcard",
59
+ "securitycode",
60
+ "twofactorcode",
61
+ "masterkey",
62
+ "servicerolekey",
63
+ "stripekey",
64
+ "rawheaders"
65
+ ];
66
+ var DEFAULT_SENSITIVE_PROPERTY_NAME_SET = new Set(DEFAULT_SENSITIVE_PROPERTY_NAMES);
67
+ var SENSITIVE_SEGMENTS = /* @__PURE__ */ new Set([
68
+ "password",
69
+ "passwd",
70
+ "pwd",
71
+ "passphrase",
72
+ "token",
73
+ "secret",
74
+ "cookie",
75
+ "cookies",
76
+ "authorization",
77
+ "auth",
78
+ "bearer",
79
+ "credential",
80
+ "credentials",
81
+ "jwt",
82
+ "otp",
83
+ "totp",
84
+ "pin",
85
+ "sid",
86
+ "dsn",
87
+ "pem",
88
+ "privkey",
89
+ "cvv",
90
+ "cvc",
91
+ "ssn",
92
+ "secrets"
93
+ ]);
94
+ var SENSITIVE_SUFFIXES = [
95
+ "password",
96
+ "passwd",
97
+ "token",
98
+ "secret",
99
+ "apikey",
100
+ "privatekey",
101
+ "credential",
102
+ "credentials",
103
+ "cookie"
104
+ ];
105
+ var compactKey = (key) => {
106
+ let compacted = "";
107
+ for (let index = 0; index < key.length; index++) {
108
+ const code = key.charCodeAt(index);
109
+ if (code === 45 || code === 46 || code === 95) continue;
110
+ compacted += code >= 65 && code <= 90 ? String.fromCharCode(code + 32) : key[index];
111
+ }
112
+ return compacted;
113
+ };
114
+ var stripTrailingDigits = (value) => {
115
+ let end = value.length;
116
+ while (end > 0) {
117
+ const code = value.charCodeAt(end - 1);
118
+ if (code < 48 || code > 57) break;
119
+ end--;
120
+ }
121
+ return end === 0 ? value : value.slice(0, end);
122
+ };
123
+ var segmentsOf = (key) => {
124
+ const segments = [];
125
+ let current = "";
126
+ for (let index = 0; index < key.length; index++) {
127
+ const char = key[index] ?? "";
128
+ const code = key.charCodeAt(index);
129
+ if (code === 45 || code === 46 || code === 95) {
130
+ if (current) segments.push(current.toLowerCase());
131
+ current = "";
132
+ continue;
133
+ }
134
+ if (current && code >= 65 && code <= 90) {
135
+ const prev = current.charCodeAt(current.length - 1);
136
+ const prevIsLower = prev >= 97 && prev <= 122;
137
+ const next = key.charCodeAt(index + 1);
138
+ const nextIsLower = next >= 97 && next <= 122;
139
+ if (prevIsLower || nextIsLower) {
140
+ segments.push(current.toLowerCase());
141
+ current = char;
142
+ continue;
143
+ }
144
+ }
145
+ current += char;
146
+ }
147
+ if (current) segments.push(current.toLowerCase());
148
+ return segments;
149
+ };
150
+ var adjacentPairsSensitive = (left, right) => left === "api" && right === "key" || left === "private" && right === "key" || left === "client" && right === "secret" || left === "set" && right === "cookie" || left === "database" && right === "url" || left === "connection" && right === "string" || left === "mongo" && (right === "uri" || right === "url") || left === "mongodb" && (right === "uri" || right === "url") || left === "redis" && (right === "uri" || right === "url") || left === "postgres" && (right === "uri" || right === "url") || left === "database" && right === "uri" || left === "signing" && right === "key" || left === "master" && right === "key" || left === "stripe" && right === "key" || left === "service" && right === "role" || left === "security" && right === "code" || left === "two" && right === "factor" || left === "encryption" && right === "key" || left === "session" && (right === "id" || right === "key" || right === "token") || left === "card" && right === "number" || left === "mfa" && right === "code";
151
+ var propertyNameIsSensitive = (key) => {
152
+ const compacted = compactKey(key);
153
+ const compactForms = [compacted, stripTrailingDigits(compacted)].filter(
154
+ (value, index, values) => value.length > 0 && values.indexOf(value) === index
155
+ );
156
+ for (const form of compactForms) {
157
+ if (DEFAULT_SENSITIVE_PROPERTY_NAME_SET.has(form)) return true;
158
+ for (const suffix of SENSITIVE_SUFFIXES) {
159
+ if (form.endsWith(suffix)) return true;
160
+ }
161
+ if (form.includes("apikey") || form.includes("xapikey")) return true;
162
+ }
163
+ const segments = segmentsOf(key).map((segment) => stripTrailingDigits(segment) || segment);
164
+ for (const segment of segments) {
165
+ if (SENSITIVE_SEGMENTS.has(segment)) return true;
166
+ }
167
+ for (let index = 0; index < segments.length - 1; index++) {
168
+ const left = segments[index];
169
+ const right = segments[index + 1];
170
+ if (left && right && adjacentPairsSensitive(left, right)) return true;
171
+ }
172
+ return false;
173
+ };
174
+
13
175
  // ../core/src/source-identity/source-identity.ts
14
176
  import { createHash } from "node:crypto";
15
177
  import { existsSync, readFileSync } from "node:fs";
@@ -685,168 +847,6 @@ var runtimeStateUnavailable = Symbol.for(
685
847
  "rasputin.runtime-state.unavailable"
686
848
  );
687
849
 
688
- // ../core/src/derivation/sensitive-property-name.ts
689
- var DEFAULT_SENSITIVE_PROPERTY_NAMES = [
690
- "password",
691
- "passwd",
692
- "pwd",
693
- "passphrase",
694
- "token",
695
- "accesstoken",
696
- "refreshtoken",
697
- "sessiontoken",
698
- "authorization",
699
- "auth",
700
- "bearer",
701
- "cookie",
702
- "cookies",
703
- "signedcookies",
704
- "setcookie",
705
- "secret",
706
- "secrets",
707
- "clientsecret",
708
- "apikey",
709
- "xapikey",
710
- "credential",
711
- "credentials",
712
- "privatekey",
713
- "privkey",
714
- "pem",
715
- "jwt",
716
- "otp",
717
- "totp",
718
- "pin",
719
- "mfacode",
720
- "sessionid",
721
- "sid",
722
- "databaseurl",
723
- "connectionstring",
724
- "dsn",
725
- "mongouri",
726
- "redisurl",
727
- "signingkey",
728
- "encryptionkey",
729
- "cvv",
730
- "cvc",
731
- "cardnumber",
732
- "ssn",
733
- "creditcard",
734
- "securitycode",
735
- "twofactorcode",
736
- "masterkey",
737
- "servicerolekey",
738
- "stripekey",
739
- "rawheaders"
740
- ];
741
- var DEFAULT_SENSITIVE_PROPERTY_NAME_SET = new Set(DEFAULT_SENSITIVE_PROPERTY_NAMES);
742
- var SENSITIVE_SEGMENTS = /* @__PURE__ */ new Set([
743
- "password",
744
- "passwd",
745
- "pwd",
746
- "passphrase",
747
- "token",
748
- "secret",
749
- "cookie",
750
- "cookies",
751
- "authorization",
752
- "auth",
753
- "bearer",
754
- "credential",
755
- "credentials",
756
- "jwt",
757
- "otp",
758
- "totp",
759
- "pin",
760
- "sid",
761
- "dsn",
762
- "pem",
763
- "privkey",
764
- "cvv",
765
- "cvc",
766
- "ssn",
767
- "secrets"
768
- ]);
769
- var SENSITIVE_SUFFIXES = [
770
- "password",
771
- "passwd",
772
- "token",
773
- "secret",
774
- "apikey",
775
- "privatekey",
776
- "credential",
777
- "credentials",
778
- "cookie"
779
- ];
780
- var compactKey = (key) => {
781
- let compacted = "";
782
- for (let index = 0; index < key.length; index++) {
783
- const code = key.charCodeAt(index);
784
- if (code === 45 || code === 46 || code === 95) continue;
785
- compacted += code >= 65 && code <= 90 ? String.fromCharCode(code + 32) : key[index];
786
- }
787
- return compacted;
788
- };
789
- var stripTrailingDigits = (value) => {
790
- let end = value.length;
791
- while (end > 0) {
792
- const code = value.charCodeAt(end - 1);
793
- if (code < 48 || code > 57) break;
794
- end--;
795
- }
796
- return end === 0 ? value : value.slice(0, end);
797
- };
798
- var segmentsOf = (key) => {
799
- const segments = [];
800
- let current = "";
801
- for (let index = 0; index < key.length; index++) {
802
- const char = key[index] ?? "";
803
- const code = key.charCodeAt(index);
804
- if (code === 45 || code === 46 || code === 95) {
805
- if (current) segments.push(current.toLowerCase());
806
- current = "";
807
- continue;
808
- }
809
- if (current && code >= 65 && code <= 90) {
810
- const prev = current.charCodeAt(current.length - 1);
811
- const prevIsLower = prev >= 97 && prev <= 122;
812
- const next = key.charCodeAt(index + 1);
813
- const nextIsLower = next >= 97 && next <= 122;
814
- if (prevIsLower || nextIsLower) {
815
- segments.push(current.toLowerCase());
816
- current = char;
817
- continue;
818
- }
819
- }
820
- current += char;
821
- }
822
- if (current) segments.push(current.toLowerCase());
823
- return segments;
824
- };
825
- var adjacentPairsSensitive = (left, right) => left === "api" && right === "key" || left === "private" && right === "key" || left === "client" && right === "secret" || left === "set" && right === "cookie" || left === "database" && right === "url" || left === "connection" && right === "string" || left === "mongo" && (right === "uri" || right === "url") || left === "mongodb" && (right === "uri" || right === "url") || left === "redis" && (right === "uri" || right === "url") || left === "postgres" && (right === "uri" || right === "url") || left === "database" && right === "uri" || left === "signing" && right === "key" || left === "master" && right === "key" || left === "stripe" && right === "key" || left === "service" && right === "role" || left === "security" && right === "code" || left === "two" && right === "factor" || left === "encryption" && right === "key" || left === "session" && (right === "id" || right === "key" || right === "token") || left === "card" && right === "number" || left === "mfa" && right === "code";
826
- var propertyNameIsSensitive = (key) => {
827
- const compacted = compactKey(key);
828
- const compactForms = [compacted, stripTrailingDigits(compacted)].filter(
829
- (value, index, values) => value.length > 0 && values.indexOf(value) === index
830
- );
831
- for (const form of compactForms) {
832
- if (DEFAULT_SENSITIVE_PROPERTY_NAME_SET.has(form)) return true;
833
- for (const suffix of SENSITIVE_SUFFIXES) {
834
- if (form.endsWith(suffix)) return true;
835
- }
836
- if (form.includes("apikey") || form.includes("xapikey")) return true;
837
- }
838
- const segments = segmentsOf(key).map((segment) => stripTrailingDigits(segment) || segment);
839
- for (const segment of segments) {
840
- if (SENSITIVE_SEGMENTS.has(segment)) return true;
841
- }
842
- for (let index = 0; index < segments.length - 1; index++) {
843
- const left = segments[index];
844
- const right = segments[index + 1];
845
- if (left && right && adjacentPairsSensitive(left, right)) return true;
846
- }
847
- return false;
848
- };
849
-
850
850
  // ../recorder/src/function-plan.ts
851
851
  var encodeFunctionPlan = (source) => {
852
852
  const locator = sourceLocatorFromFile(source.filePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasputin-ai/browser",
3
- "version": "0.7.1",
3
+ "version": "0.7.2-beta.1",
4
4
  "description": "Official Rasputin AI SDK for browser applications.",
5
5
  "type": "module",
6
6
  "exports": {