@n8n/utils 1.36.0 → 1.37.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.
Files changed (176) hide show
  1. package/dist/create-event-queue.cjs +3 -0
  2. package/dist/create-event-queue.d.cts +2 -0
  3. package/dist/create-event-queue.d.mts +2 -0
  4. package/dist/create-event-queue.mjs +3 -0
  5. package/dist/{event-queue2.cjs → create-event-queue2.cjs} +2 -2
  6. package/dist/create-event-queue2.cjs.map +1 -0
  7. package/dist/{event-queue2.d.cts → create-event-queue2.d.cts} +2 -2
  8. package/dist/{event-queue2.d.mts → create-event-queue2.d.mts} +2 -2
  9. package/dist/{event-queue2.mjs → create-event-queue2.mjs} +2 -2
  10. package/dist/create-event-queue2.mjs.map +1 -0
  11. package/dist/files/is-windows-file-path.cjs +3 -0
  12. package/dist/files/is-windows-file-path.d.cts +2 -0
  13. package/dist/files/is-windows-file-path.d.mts +2 -0
  14. package/dist/files/is-windows-file-path.mjs +3 -0
  15. package/dist/files/sanitize-filename.cjs +3 -0
  16. package/dist/files/sanitize-filename.d.cts +2 -0
  17. package/dist/files/sanitize-filename.d.mts +2 -0
  18. package/dist/files/sanitize-filename.mjs +3 -0
  19. package/dist/format-pem-block.cjs +3 -0
  20. package/dist/format-pem-block.d.cts +2 -0
  21. package/dist/format-pem-block.d.mts +2 -0
  22. package/dist/format-pem-block.mjs +3 -0
  23. package/dist/format-pem-block2.cjs +47 -0
  24. package/dist/format-pem-block2.cjs.map +1 -0
  25. package/dist/format-pem-block2.d.cts +5 -0
  26. package/dist/format-pem-block2.d.mts +5 -0
  27. package/dist/format-pem-block2.mjs +41 -0
  28. package/dist/format-pem-block2.mjs.map +1 -0
  29. package/dist/generate-nano-id.cjs +3 -0
  30. package/dist/generate-nano-id.d.cts +2 -0
  31. package/dist/generate-nano-id.d.mts +2 -0
  32. package/dist/generate-nano-id.mjs +3 -0
  33. package/dist/{workflowId2.cjs → generate-nano-id2.cjs} +2 -2
  34. package/dist/generate-nano-id2.cjs.map +1 -0
  35. package/dist/{workflowId2.d.cts → generate-nano-id2.d.cts} +2 -2
  36. package/dist/{workflowId2.d.mts → generate-nano-id2.d.mts} +2 -2
  37. package/dist/{workflowId2.mjs → generate-nano-id2.mjs} +2 -2
  38. package/dist/generate-nano-id2.mjs.map +1 -0
  39. package/dist/get-jwt-expiry.cjs +3 -0
  40. package/dist/get-jwt-expiry.d.cts +2 -0
  41. package/dist/get-jwt-expiry.d.mts +2 -0
  42. package/dist/get-jwt-expiry.mjs +3 -0
  43. package/dist/{jwt2.cjs → get-jwt-expiry2.cjs} +2 -2
  44. package/dist/get-jwt-expiry2.cjs.map +1 -0
  45. package/dist/{jwt2.d.cts → get-jwt-expiry2.d.cts} +2 -2
  46. package/dist/{jwt2.d.mts → get-jwt-expiry2.d.mts} +2 -2
  47. package/dist/{jwt2.mjs → get-jwt-expiry2.mjs} +2 -2
  48. package/dist/get-jwt-expiry2.mjs.map +1 -0
  49. package/dist/index.cjs +23 -21
  50. package/dist/index.d.cts +12 -11
  51. package/dist/index.d.mts +12 -11
  52. package/dist/index.mjs +12 -11
  53. package/dist/is-record.cjs +3 -0
  54. package/dist/is-record.d.cts +2 -0
  55. package/dist/is-record.d.mts +2 -0
  56. package/dist/is-record.mjs +3 -0
  57. package/dist/{validation2.cjs → is-record2.cjs} +2 -2
  58. package/dist/is-record2.cjs.map +1 -0
  59. package/dist/{validation2.d.cts → is-record2.d.cts} +2 -2
  60. package/dist/{validation2.d.mts → is-record2.d.mts} +2 -2
  61. package/dist/{validation2.mjs → is-record2.mjs} +2 -2
  62. package/dist/is-record2.mjs.map +1 -0
  63. package/dist/{path.cjs → is-windows-file-path.cjs} +2 -2
  64. package/dist/is-windows-file-path.cjs.map +1 -0
  65. package/dist/{path.d.cts → is-windows-file-path.d.cts} +2 -2
  66. package/dist/{path.d.mts → is-windows-file-path.d.mts} +2 -2
  67. package/dist/{path.mjs → is-windows-file-path.mjs} +2 -2
  68. package/dist/is-windows-file-path.mjs.map +1 -0
  69. package/dist/number/smart-decimal.cjs +3 -0
  70. package/dist/number/smart-decimal.d.cts +2 -0
  71. package/dist/number/smart-decimal.d.mts +2 -0
  72. package/dist/number/smart-decimal.mjs +3 -0
  73. package/dist/{reRankSearchResults.cjs → re-rank-search-results.cjs} +2 -2
  74. package/dist/re-rank-search-results.cjs.map +1 -0
  75. package/dist/{reRankSearchResults.d.cts → re-rank-search-results.d.cts} +2 -2
  76. package/dist/{reRankSearchResults.d.mts → re-rank-search-results.d.mts} +2 -2
  77. package/dist/{reRankSearchResults.mjs → re-rank-search-results.mjs} +2 -2
  78. package/dist/re-rank-search-results.mjs.map +1 -0
  79. package/dist/{sanitize.cjs → sanitize-filename.cjs} +2 -2
  80. package/dist/sanitize-filename.cjs.map +1 -0
  81. package/dist/{sanitize.d.cts → sanitize-filename.d.cts} +2 -2
  82. package/dist/{sanitize.d.mts → sanitize-filename.d.mts} +2 -2
  83. package/dist/{sanitize.mjs → sanitize-filename.mjs} +2 -2
  84. package/dist/sanitize-filename.mjs.map +1 -0
  85. package/dist/scrub-secrets2.cjs +3 -3
  86. package/dist/scrub-secrets2.cjs.map +1 -1
  87. package/dist/scrub-secrets2.mjs +3 -3
  88. package/dist/scrub-secrets2.mjs.map +1 -1
  89. package/dist/search/re-rank-search-results.cjs +3 -0
  90. package/dist/search/re-rank-search-results.d.cts +2 -0
  91. package/dist/search/re-rank-search-results.d.mts +2 -0
  92. package/dist/search/re-rank-search-results.mjs +3 -0
  93. package/dist/search/sublime-search.cjs +4 -0
  94. package/dist/search/{sublimeSearch.d.cts → sublime-search.d.cts} +1 -1
  95. package/dist/search/{sublimeSearch.d.mts → sublime-search.d.mts} +1 -1
  96. package/dist/search/{sublimeSearch.mjs → sublime-search.mjs} +1 -1
  97. package/dist/{smartDecimal.cjs → smart-decimal.cjs} +2 -2
  98. package/dist/smart-decimal.cjs.map +1 -0
  99. package/dist/{smartDecimal.d.cts → smart-decimal.d.cts} +2 -2
  100. package/dist/{smartDecimal.d.mts → smart-decimal.d.mts} +2 -2
  101. package/dist/{smartDecimal.mjs → smart-decimal.mjs} +2 -2
  102. package/dist/smart-decimal.mjs.map +1 -0
  103. package/dist/sort/sort-by-property.cjs +3 -0
  104. package/dist/sort/sort-by-property.d.cts +2 -0
  105. package/dist/sort/sort-by-property.d.mts +2 -0
  106. package/dist/sort/sort-by-property.mjs +3 -0
  107. package/dist/{sortByProperty.cjs → sort-by-property.cjs} +2 -2
  108. package/dist/sort-by-property.cjs.map +1 -0
  109. package/dist/{sortByProperty.d.cts → sort-by-property.d.cts} +2 -2
  110. package/dist/{sortByProperty.d.mts → sort-by-property.d.mts} +2 -2
  111. package/dist/{sortByProperty.mjs → sort-by-property.mjs} +2 -2
  112. package/dist/sort-by-property.mjs.map +1 -0
  113. package/dist/{sublimeSearch.cjs → sublime-search.cjs} +2 -2
  114. package/dist/sublime-search.cjs.map +1 -0
  115. package/dist/{sublimeSearch.d.cts → sublime-search.d.cts} +2 -2
  116. package/dist/{sublimeSearch.d.mts → sublime-search.d.mts} +2 -2
  117. package/dist/{sublimeSearch.mjs → sublime-search.mjs} +2 -2
  118. package/dist/sublime-search.mjs.map +1 -0
  119. package/package.json +7 -7
  120. package/dist/event-queue.cjs +0 -3
  121. package/dist/event-queue.d.cts +0 -2
  122. package/dist/event-queue.d.mts +0 -2
  123. package/dist/event-queue.mjs +0 -3
  124. package/dist/event-queue2.cjs.map +0 -1
  125. package/dist/event-queue2.mjs.map +0 -1
  126. package/dist/files/path.cjs +0 -3
  127. package/dist/files/path.d.cts +0 -2
  128. package/dist/files/path.d.mts +0 -2
  129. package/dist/files/path.mjs +0 -3
  130. package/dist/files/sanitize.cjs +0 -3
  131. package/dist/files/sanitize.d.cts +0 -2
  132. package/dist/files/sanitize.d.mts +0 -2
  133. package/dist/files/sanitize.mjs +0 -3
  134. package/dist/jwt.cjs +0 -3
  135. package/dist/jwt.d.cts +0 -2
  136. package/dist/jwt.d.mts +0 -2
  137. package/dist/jwt.mjs +0 -3
  138. package/dist/jwt2.cjs.map +0 -1
  139. package/dist/jwt2.mjs.map +0 -1
  140. package/dist/number/smartDecimal.cjs +0 -3
  141. package/dist/number/smartDecimal.d.cts +0 -2
  142. package/dist/number/smartDecimal.d.mts +0 -2
  143. package/dist/number/smartDecimal.mjs +0 -3
  144. package/dist/path.cjs.map +0 -1
  145. package/dist/path.mjs.map +0 -1
  146. package/dist/reRankSearchResults.cjs.map +0 -1
  147. package/dist/reRankSearchResults.mjs.map +0 -1
  148. package/dist/sanitize.cjs.map +0 -1
  149. package/dist/sanitize.mjs.map +0 -1
  150. package/dist/search/reRankSearchResults.cjs +0 -3
  151. package/dist/search/reRankSearchResults.d.cts +0 -2
  152. package/dist/search/reRankSearchResults.d.mts +0 -2
  153. package/dist/search/reRankSearchResults.mjs +0 -3
  154. package/dist/search/sublimeSearch.cjs +0 -4
  155. package/dist/smartDecimal.cjs.map +0 -1
  156. package/dist/smartDecimal.mjs.map +0 -1
  157. package/dist/sort/sortByProperty.cjs +0 -3
  158. package/dist/sort/sortByProperty.d.cts +0 -2
  159. package/dist/sort/sortByProperty.d.mts +0 -2
  160. package/dist/sort/sortByProperty.mjs +0 -3
  161. package/dist/sortByProperty.cjs.map +0 -1
  162. package/dist/sortByProperty.mjs.map +0 -1
  163. package/dist/sublimeSearch.cjs.map +0 -1
  164. package/dist/sublimeSearch.mjs.map +0 -1
  165. package/dist/validation.cjs +0 -3
  166. package/dist/validation.d.cts +0 -2
  167. package/dist/validation.d.mts +0 -2
  168. package/dist/validation.mjs +0 -3
  169. package/dist/validation2.cjs.map +0 -1
  170. package/dist/validation2.mjs.map +0 -1
  171. package/dist/workflowId.cjs +0 -3
  172. package/dist/workflowId.d.cts +0 -2
  173. package/dist/workflowId.d.mts +0 -2
  174. package/dist/workflowId.mjs +0 -3
  175. package/dist/workflowId2.cjs.map +0 -1
  176. package/dist/workflowId2.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/validation.ts
2
+ //#region src/is-record.ts
3
3
  function isRecord(value) {
4
4
  return typeof value === "object" && value !== null && !Array.isArray(value);
5
5
  }
@@ -11,4 +11,4 @@ Object.defineProperty(exports, 'isRecord', {
11
11
  return isRecord;
12
12
  }
13
13
  });
14
- //# sourceMappingURL=validation2.cjs.map
14
+ //# sourceMappingURL=is-record2.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-record2.cjs","names":[],"sources":["../src/is-record.ts"],"sourcesContent":["export function isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"],"mappings":";;AAAA,SAAgB,SAAS,OAAkD;AAC1E,QAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM"}
@@ -1,5 +1,5 @@
1
- //#region src/validation.d.ts
1
+ //#region src/is-record.d.ts
2
2
  declare function isRecord(value: unknown): value is Record<string, unknown>;
3
3
  //#endregion
4
4
  export { isRecord as t };
5
- //# sourceMappingURL=validation2.d.cts.map
5
+ //# sourceMappingURL=is-record2.d.cts.map
@@ -1,5 +1,5 @@
1
- //#region src/validation.d.ts
1
+ //#region src/is-record.d.ts
2
2
  declare function isRecord(value: unknown): value is Record<string, unknown>;
3
3
  //#endregion
4
4
  export { isRecord as t };
5
- //# sourceMappingURL=validation2.d.mts.map
5
+ //# sourceMappingURL=is-record2.d.mts.map
@@ -1,8 +1,8 @@
1
- //#region src/validation.ts
1
+ //#region src/is-record.ts
2
2
  function isRecord(value) {
3
3
  return typeof value === "object" && value !== null && !Array.isArray(value);
4
4
  }
5
5
 
6
6
  //#endregion
7
7
  export { isRecord as t };
8
- //# sourceMappingURL=validation2.mjs.map
8
+ //# sourceMappingURL=is-record2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-record2.mjs","names":[],"sources":["../src/is-record.ts"],"sourcesContent":["export function isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"],"mappings":";AAAA,SAAgB,SAAS,OAAkD;AAC1E,QAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM"}
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/files/path.ts
2
+ //#region src/files/is-windows-file-path.ts
3
3
  /**
4
4
  * Fast check if file path starts with a windows drive letter, e.g. 'C:/' or 'C:\\'
5
5
  */
@@ -14,4 +14,4 @@ Object.defineProperty(exports, 'isWindowsFilePath', {
14
14
  return isWindowsFilePath;
15
15
  }
16
16
  });
17
- //# sourceMappingURL=path.cjs.map
17
+ //# sourceMappingURL=is-windows-file-path.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-windows-file-path.cjs","names":[],"sources":["../src/files/is-windows-file-path.ts"],"sourcesContent":["/**\n * Fast check if file path starts with a windows drive letter, e.g. 'C:/' or 'C:\\\\'\n */\nexport function isWindowsFilePath(str: string) {\n\treturn /^[a-zA-Z]:[\\\\/]/.test(str);\n}\n"],"mappings":";;;;;AAGA,SAAgB,kBAAkB,KAAa;AAC9C,QAAO,kBAAkB,KAAK,IAAI"}
@@ -1,5 +1,5 @@
1
- //#region src/files/path.d.ts
1
+ //#region src/files/is-windows-file-path.d.ts
2
2
  declare function isWindowsFilePath(str: string): boolean;
3
3
  //#endregion
4
4
  export { isWindowsFilePath as t };
5
- //# sourceMappingURL=path.d.cts.map
5
+ //# sourceMappingURL=is-windows-file-path.d.cts.map
@@ -1,5 +1,5 @@
1
- //#region src/files/path.d.ts
1
+ //#region src/files/is-windows-file-path.d.ts
2
2
  declare function isWindowsFilePath(str: string): boolean;
3
3
  //#endregion
4
4
  export { isWindowsFilePath as t };
5
- //# sourceMappingURL=path.d.mts.map
5
+ //# sourceMappingURL=is-windows-file-path.d.mts.map
@@ -1,4 +1,4 @@
1
- //#region src/files/path.ts
1
+ //#region src/files/is-windows-file-path.ts
2
2
  /**
3
3
  * Fast check if file path starts with a windows drive letter, e.g. 'C:/' or 'C:\\'
4
4
  */
@@ -8,4 +8,4 @@ function isWindowsFilePath(str) {
8
8
 
9
9
  //#endregion
10
10
  export { isWindowsFilePath as t };
11
- //# sourceMappingURL=path.mjs.map
11
+ //# sourceMappingURL=is-windows-file-path.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-windows-file-path.mjs","names":[],"sources":["../src/files/is-windows-file-path.ts"],"sourcesContent":["/**\n * Fast check if file path starts with a windows drive letter, e.g. 'C:/' or 'C:\\\\'\n */\nexport function isWindowsFilePath(str: string) {\n\treturn /^[a-zA-Z]:[\\\\/]/.test(str);\n}\n"],"mappings":";;;;AAGA,SAAgB,kBAAkB,KAAa;AAC9C,QAAO,kBAAkB,KAAK,IAAI"}
@@ -0,0 +1,3 @@
1
+ const require_smart_decimal = require('../smart-decimal.cjs');
2
+
3
+ exports.smartDecimal = require_smart_decimal.smartDecimal;
@@ -0,0 +1,2 @@
1
+ import { t as smartDecimal } from "../smart-decimal.cjs";
2
+ export { smartDecimal };
@@ -0,0 +1,2 @@
1
+ import { t as smartDecimal } from "../smart-decimal.mjs";
2
+ export { smartDecimal };
@@ -0,0 +1,3 @@
1
+ import { t as smartDecimal } from "../smart-decimal.mjs";
2
+
3
+ export { smartDecimal };
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/search/reRankSearchResults.ts
2
+ //#region src/search/re-rank-search-results.ts
3
3
  function reRankSearchResults(searchResults, additionalFactors) {
4
4
  return searchResults.map(({ score, item }) => {
5
5
  return {
@@ -22,4 +22,4 @@ Object.defineProperty(exports, 'reRankSearchResults', {
22
22
  return reRankSearchResults;
23
23
  }
24
24
  });
25
- //# sourceMappingURL=reRankSearchResults.cjs.map
25
+ //# sourceMappingURL=re-rank-search-results.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"re-rank-search-results.cjs","names":[],"sources":["../src/search/re-rank-search-results.ts"],"sourcesContent":["export function reRankSearchResults<T extends { key: string }>(\n\tsearchResults: Array<{ score: number; item: T }>,\n\tadditionalFactors: Record<string, Record<string, number>>,\n): Array<{ score: number; item: T }> {\n\treturn searchResults\n\t\t.map(({ score, item }) => {\n\t\t\t// For each additional factor, we check if it exists for the item and type,\n\t\t\t// and if so, we add the score to the item's score.\n\t\t\tconst additionalScore = Object.entries(additionalFactors).reduce((acc, [_, factorScores]) => {\n\t\t\t\tconst factorScore = factorScores[item.key];\n\t\t\t\tif (factorScore) {\n\t\t\t\t\treturn acc + factorScore;\n\t\t\t\t}\n\n\t\t\t\treturn acc;\n\t\t\t}, 0);\n\n\t\t\treturn {\n\t\t\t\tscore: score + additionalScore,\n\t\t\t\titem,\n\t\t\t};\n\t\t})\n\t\t.sort((a, b) => {\n\t\t\treturn b.score - a.score;\n\t\t});\n}\n"],"mappings":";;AAAA,SAAgB,oBACf,eACA,mBACoC;AACpC,QAAO,cACL,KAAK,EAAE,OAAO,WAAW;AAYzB,SAAO;GACN,OAAO,QAVgB,OAAO,QAAQ,kBAAkB,CAAC,QAAQ,KAAK,CAAC,GAAG,kBAAkB;IAC5F,MAAM,cAAc,aAAa,KAAK;AACtC,QAAI,YACH,QAAO,MAAM;AAGd,WAAO;MACL,EAAE;GAIJ;GACA;GACA,CACD,MAAM,GAAG,MAAM;AACf,SAAO,EAAE,QAAQ,EAAE;GAClB"}
@@ -1,4 +1,4 @@
1
- //#region src/search/reRankSearchResults.d.ts
1
+ //#region src/search/re-rank-search-results.d.ts
2
2
  declare function reRankSearchResults<T extends {
3
3
  key: string;
4
4
  }>(searchResults: Array<{
@@ -10,4 +10,4 @@ declare function reRankSearchResults<T extends {
10
10
  }>;
11
11
  //#endregion
12
12
  export { reRankSearchResults as t };
13
- //# sourceMappingURL=reRankSearchResults.d.cts.map
13
+ //# sourceMappingURL=re-rank-search-results.d.cts.map
@@ -1,4 +1,4 @@
1
- //#region src/search/reRankSearchResults.d.ts
1
+ //#region src/search/re-rank-search-results.d.ts
2
2
  declare function reRankSearchResults<T extends {
3
3
  key: string;
4
4
  }>(searchResults: Array<{
@@ -10,4 +10,4 @@ declare function reRankSearchResults<T extends {
10
10
  }>;
11
11
  //#endregion
12
12
  export { reRankSearchResults as t };
13
- //# sourceMappingURL=reRankSearchResults.d.mts.map
13
+ //# sourceMappingURL=re-rank-search-results.d.mts.map
@@ -1,4 +1,4 @@
1
- //#region src/search/reRankSearchResults.ts
1
+ //#region src/search/re-rank-search-results.ts
2
2
  function reRankSearchResults(searchResults, additionalFactors) {
3
3
  return searchResults.map(({ score, item }) => {
4
4
  return {
@@ -16,4 +16,4 @@ function reRankSearchResults(searchResults, additionalFactors) {
16
16
 
17
17
  //#endregion
18
18
  export { reRankSearchResults as t };
19
- //# sourceMappingURL=reRankSearchResults.mjs.map
19
+ //# sourceMappingURL=re-rank-search-results.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"re-rank-search-results.mjs","names":[],"sources":["../src/search/re-rank-search-results.ts"],"sourcesContent":["export function reRankSearchResults<T extends { key: string }>(\n\tsearchResults: Array<{ score: number; item: T }>,\n\tadditionalFactors: Record<string, Record<string, number>>,\n): Array<{ score: number; item: T }> {\n\treturn searchResults\n\t\t.map(({ score, item }) => {\n\t\t\t// For each additional factor, we check if it exists for the item and type,\n\t\t\t// and if so, we add the score to the item's score.\n\t\t\tconst additionalScore = Object.entries(additionalFactors).reduce((acc, [_, factorScores]) => {\n\t\t\t\tconst factorScore = factorScores[item.key];\n\t\t\t\tif (factorScore) {\n\t\t\t\t\treturn acc + factorScore;\n\t\t\t\t}\n\n\t\t\t\treturn acc;\n\t\t\t}, 0);\n\n\t\t\treturn {\n\t\t\t\tscore: score + additionalScore,\n\t\t\t\titem,\n\t\t\t};\n\t\t})\n\t\t.sort((a, b) => {\n\t\t\treturn b.score - a.score;\n\t\t});\n}\n"],"mappings":";AAAA,SAAgB,oBACf,eACA,mBACoC;AACpC,QAAO,cACL,KAAK,EAAE,OAAO,WAAW;AAYzB,SAAO;GACN,OAAO,QAVgB,OAAO,QAAQ,kBAAkB,CAAC,QAAQ,KAAK,CAAC,GAAG,kBAAkB;IAC5F,MAAM,cAAc,aAAa,KAAK;AACtC,QAAI,YACH,QAAO,MAAM;AAGd,WAAO;MACL,EAAE;GAIJ;GACA;GACA,CACD,MAAM,GAAG,MAAM;AACf,SAAO,EAAE,QAAQ,EAAE;GAClB"}
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/files/sanitize.ts
2
+ //#region src/files/sanitize-filename.ts
3
3
  const INVALID_CHARS_REGEX = /[<>:"/\\|?*\u0000-\u001F\u007F-\u009F]/g;
4
4
  const ZERO_WIDTH_CHARS_REGEX = /[\u200B-\u200D\u2060\uFEFF]/g;
5
5
  const UNICODE_SPACES_REGEX = /[\u00A0\u2000-\u200A]/g;
@@ -64,4 +64,4 @@ Object.defineProperty(exports, 'sanitizeFilename', {
64
64
  return sanitizeFilename;
65
65
  }
66
66
  });
67
- //# sourceMappingURL=sanitize.cjs.map
67
+ //# sourceMappingURL=sanitize-filename.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-filename.cjs","names":[],"sources":["../src/files/sanitize-filename.ts"],"sourcesContent":["// Constants definition\n/* eslint-disable no-control-regex */\nconst INVALID_CHARS_REGEX = /[<>:\"/\\\\|?*\\u0000-\\u001F\\u007F-\\u009F]/g;\nconst ZERO_WIDTH_CHARS_REGEX = /[\\u200B-\\u200D\\u2060\\uFEFF]/g;\nconst UNICODE_SPACES_REGEX = /[\\u00A0\\u2000-\\u200A]/g;\nconst LEADING_TRAILING_DOTS_SPACES_REGEX = /^[\\s.]+|[\\s.]+$/g;\n/* eslint-enable no-control-regex */\n\nconst WINDOWS_RESERVED_NAMES = new Set([\n\t'CON',\n\t'PRN',\n\t'AUX',\n\t'NUL',\n\t'COM1',\n\t'COM2',\n\t'COM3',\n\t'COM4',\n\t'COM5',\n\t'COM6',\n\t'COM7',\n\t'COM8',\n\t'COM9',\n\t'LPT1',\n\t'LPT2',\n\t'LPT3',\n\t'LPT4',\n\t'LPT5',\n\t'LPT6',\n\t'LPT7',\n\t'LPT8',\n\t'LPT9',\n]);\n\nconst DEFAULT_FALLBACK_NAME = 'untitled';\nconst MAX_FILENAME_LENGTH = 200;\n\n/**\n * Sanitizes a filename to be compatible with Mac, Linux, and Windows file systems\n *\n * Main features:\n * - Replace invalid characters (e.g. \":\" in hello:world)\n * - Handle Windows reserved names\n * - Limit filename length\n * - Normalize Unicode characters\n *\n * @param filename - The filename to sanitize (without extension)\n * @param maxLength - Maximum filename length (default: 200)\n * @returns A sanitized filename (without extension)\n *\n * @example\n * sanitizeFilename('hello:world') // returns 'hello_world'\n * sanitizeFilename('CON') // returns '_CON'\n * sanitizeFilename('') // returns 'untitled'\n */\nexport const sanitizeFilename = (\n\tfilename: string,\n\tmaxLength: number = MAX_FILENAME_LENGTH,\n): string => {\n\t// Input validation\n\tif (!filename) {\n\t\treturn DEFAULT_FALLBACK_NAME;\n\t}\n\n\tlet baseName = filename\n\t\t.trim()\n\t\t.replace(INVALID_CHARS_REGEX, '_')\n\t\t.replace(ZERO_WIDTH_CHARS_REGEX, '')\n\t\t.replace(UNICODE_SPACES_REGEX, ' ')\n\t\t.replace(LEADING_TRAILING_DOTS_SPACES_REGEX, '');\n\n\t// Handle empty or invalid filenames after cleaning\n\tif (!baseName) {\n\t\tbaseName = DEFAULT_FALLBACK_NAME;\n\t}\n\n\t// Handle Windows reserved names\n\tif (WINDOWS_RESERVED_NAMES.has(baseName.toUpperCase())) {\n\t\tbaseName = `_${baseName}`;\n\t}\n\n\t// Truncate if too long\n\tif (baseName.length > maxLength) {\n\t\tbaseName = baseName.slice(0, maxLength);\n\t}\n\n\treturn baseName;\n};\n"],"mappings":";;AAEA,MAAM,sBAAsB;AAC5B,MAAM,yBAAyB;AAC/B,MAAM,uBAAuB;AAC7B,MAAM,qCAAqC;AAG3C,MAAM,yBAAyB,IAAI,IAAI;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CAAC;AAEF,MAAM,wBAAwB;AAC9B,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;AAoB5B,MAAa,oBACZ,UACA,YAAoB,wBACR;AAEZ,KAAI,CAAC,SACJ,QAAO;CAGR,IAAI,WAAW,SACb,MAAM,CACN,QAAQ,qBAAqB,IAAI,CACjC,QAAQ,wBAAwB,GAAG,CACnC,QAAQ,sBAAsB,IAAI,CAClC,QAAQ,oCAAoC,GAAG;AAGjD,KAAI,CAAC,SACJ,YAAW;AAIZ,KAAI,uBAAuB,IAAI,SAAS,aAAa,CAAC,CACrD,YAAW,IAAI;AAIhB,KAAI,SAAS,SAAS,UACrB,YAAW,SAAS,MAAM,GAAG,UAAU;AAGxC,QAAO"}
@@ -1,5 +1,5 @@
1
- //#region src/files/sanitize.d.ts
1
+ //#region src/files/sanitize-filename.d.ts
2
2
  declare const sanitizeFilename: (filename: string, maxLength?: number) => string;
3
3
  //#endregion
4
4
  export { sanitizeFilename as t };
5
- //# sourceMappingURL=sanitize.d.cts.map
5
+ //# sourceMappingURL=sanitize-filename.d.cts.map
@@ -1,5 +1,5 @@
1
- //#region src/files/sanitize.d.ts
1
+ //#region src/files/sanitize-filename.d.ts
2
2
  declare const sanitizeFilename: (filename: string, maxLength?: number) => string;
3
3
  //#endregion
4
4
  export { sanitizeFilename as t };
5
- //# sourceMappingURL=sanitize.d.mts.map
5
+ //# sourceMappingURL=sanitize-filename.d.mts.map
@@ -1,4 +1,4 @@
1
- //#region src/files/sanitize.ts
1
+ //#region src/files/sanitize-filename.ts
2
2
  const INVALID_CHARS_REGEX = /[<>:"/\\|?*\u0000-\u001F\u007F-\u009F]/g;
3
3
  const ZERO_WIDTH_CHARS_REGEX = /[\u200B-\u200D\u2060\uFEFF]/g;
4
4
  const UNICODE_SPACES_REGEX = /[\u00A0\u2000-\u200A]/g;
@@ -58,4 +58,4 @@ const sanitizeFilename = (filename, maxLength = MAX_FILENAME_LENGTH) => {
58
58
 
59
59
  //#endregion
60
60
  export { sanitizeFilename as t };
61
- //# sourceMappingURL=sanitize.mjs.map
61
+ //# sourceMappingURL=sanitize-filename.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-filename.mjs","names":[],"sources":["../src/files/sanitize-filename.ts"],"sourcesContent":["// Constants definition\n/* eslint-disable no-control-regex */\nconst INVALID_CHARS_REGEX = /[<>:\"/\\\\|?*\\u0000-\\u001F\\u007F-\\u009F]/g;\nconst ZERO_WIDTH_CHARS_REGEX = /[\\u200B-\\u200D\\u2060\\uFEFF]/g;\nconst UNICODE_SPACES_REGEX = /[\\u00A0\\u2000-\\u200A]/g;\nconst LEADING_TRAILING_DOTS_SPACES_REGEX = /^[\\s.]+|[\\s.]+$/g;\n/* eslint-enable no-control-regex */\n\nconst WINDOWS_RESERVED_NAMES = new Set([\n\t'CON',\n\t'PRN',\n\t'AUX',\n\t'NUL',\n\t'COM1',\n\t'COM2',\n\t'COM3',\n\t'COM4',\n\t'COM5',\n\t'COM6',\n\t'COM7',\n\t'COM8',\n\t'COM9',\n\t'LPT1',\n\t'LPT2',\n\t'LPT3',\n\t'LPT4',\n\t'LPT5',\n\t'LPT6',\n\t'LPT7',\n\t'LPT8',\n\t'LPT9',\n]);\n\nconst DEFAULT_FALLBACK_NAME = 'untitled';\nconst MAX_FILENAME_LENGTH = 200;\n\n/**\n * Sanitizes a filename to be compatible with Mac, Linux, and Windows file systems\n *\n * Main features:\n * - Replace invalid characters (e.g. \":\" in hello:world)\n * - Handle Windows reserved names\n * - Limit filename length\n * - Normalize Unicode characters\n *\n * @param filename - The filename to sanitize (without extension)\n * @param maxLength - Maximum filename length (default: 200)\n * @returns A sanitized filename (without extension)\n *\n * @example\n * sanitizeFilename('hello:world') // returns 'hello_world'\n * sanitizeFilename('CON') // returns '_CON'\n * sanitizeFilename('') // returns 'untitled'\n */\nexport const sanitizeFilename = (\n\tfilename: string,\n\tmaxLength: number = MAX_FILENAME_LENGTH,\n): string => {\n\t// Input validation\n\tif (!filename) {\n\t\treturn DEFAULT_FALLBACK_NAME;\n\t}\n\n\tlet baseName = filename\n\t\t.trim()\n\t\t.replace(INVALID_CHARS_REGEX, '_')\n\t\t.replace(ZERO_WIDTH_CHARS_REGEX, '')\n\t\t.replace(UNICODE_SPACES_REGEX, ' ')\n\t\t.replace(LEADING_TRAILING_DOTS_SPACES_REGEX, '');\n\n\t// Handle empty or invalid filenames after cleaning\n\tif (!baseName) {\n\t\tbaseName = DEFAULT_FALLBACK_NAME;\n\t}\n\n\t// Handle Windows reserved names\n\tif (WINDOWS_RESERVED_NAMES.has(baseName.toUpperCase())) {\n\t\tbaseName = `_${baseName}`;\n\t}\n\n\t// Truncate if too long\n\tif (baseName.length > maxLength) {\n\t\tbaseName = baseName.slice(0, maxLength);\n\t}\n\n\treturn baseName;\n};\n"],"mappings":";AAEA,MAAM,sBAAsB;AAC5B,MAAM,yBAAyB;AAC/B,MAAM,uBAAuB;AAC7B,MAAM,qCAAqC;AAG3C,MAAM,yBAAyB,IAAI,IAAI;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CAAC;AAEF,MAAM,wBAAwB;AAC9B,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;AAoB5B,MAAa,oBACZ,UACA,YAAoB,wBACR;AAEZ,KAAI,CAAC,SACJ,QAAO;CAGR,IAAI,WAAW,SACb,MAAM,CACN,QAAQ,qBAAqB,IAAI,CACjC,QAAQ,wBAAwB,GAAG,CACnC,QAAQ,sBAAsB,IAAI,CAClC,QAAQ,oCAAoC,GAAG;AAGjD,KAAI,CAAC,SACJ,YAAW;AAIZ,KAAI,uBAAuB,IAAI,SAAS,aAAa,CAAC,CACrD,YAAW,IAAI;AAIhB,KAAI,SAAS,SAAS,UACrB,YAAW,SAAS,MAAM,GAAG,UAAU;AAGxC,QAAO"}
@@ -27,9 +27,9 @@ const SECRET_VALUE_PATTERNS = [
27
27
  /\bgithub_pat_[A-Za-z0-9_]{22,}/g,
28
28
  /\bAKIA[0-9A-Z]{16}\b/g,
29
29
  /(?<=:\/\/)[^\s:/@]+:[^\s:/@]+(?=@)/g,
30
- new RegExp(`"(?:${SECRET_KEYS})"\\s*:\\s*"(?!\\[(?:redacted|REDACTED)\\]")(?:\\\\.|[^"\\r\\n])*"`, "gi"),
31
- new RegExp(`'(?:${SECRET_KEYS})'\\s*:\\s*'(?!\\[(?:redacted|REDACTED)\\]')(?:\\\\.|[^'\\r\\n])*'`, "gi"),
32
- new RegExp(`\\b(?:${SECRET_KEYS})\\s*[:=]\\s*\\S+`, "gi")
30
+ new RegExp(`"(?:${SECRET_KEYS})"\\s*:\\s*"(?!\\[(?:redacted|REDACTED)(?::[^"\\]]*)?\\]")(?:\\\\.|[^"\\r\\n])*"`, "gi"),
31
+ new RegExp(`'(?:${SECRET_KEYS})'\\s*:\\s*'(?!\\[(?:redacted|REDACTED)(?::[^'\\]]*)?\\]')(?:\\\\.|[^'\\r\\n])*'`, "gi"),
32
+ new RegExp(`(?<!\\[(?:redacted|REDACTED):)\\b(?:${SECRET_KEYS})\\s*[:=]\\s*\\S+`, "gi")
33
33
  ];
34
34
  function scrubSecretsInText(input) {
35
35
  let out = input;
@@ -1 +1 @@
1
- {"version":3,"file":"scrub-secrets2.cjs","names":["SECRET_VALUE_PATTERNS: readonly RegExp[]"],"sources":["../src/scrub-secrets.ts"],"sourcesContent":["/**\n * Replace common credential patterns in free-form text with `[REDACTED]`.\n *\n * Used before persisting or transmitting user-supplied text (telemetry\n * excerpts, eval report HTML, free-form feedback) where keys/tokens\n * accidentally pasted into prompts or command lines could otherwise leak\n * downstream.\n *\n * Conservative by design: matches well-known prefixed tokens, explicit\n * `key=value` pairs, and quoted JSON/JS-object fields with sensitive\n * names. We don't attempt to redact arbitrary long opaque strings — false\n * positives on file paths, IDs, or base64 payloads would make the output\n * unreadable.\n */\nexport const SECRET_KEYS =\n\t'password|passwd|secret|credentials?|api[_-]?key|authorization|access[_-]?token|refresh[_-]?token|id[_-]?token|session[_-]?token|auth[_-]?token';\n\nexport const SECRET_VALUE_PATTERNS: readonly RegExp[] = [\n\t// PEM private-key blocks (RSA/EC/DSA/OpenSSH/PGP). Whole block, multiline.\n\t/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----[\\s\\S]*?-----END (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/g,\n\t// JWTs: `eyJ<header>.eyJ<payload>.<signature>` (both leading segments are\n\t// base64url of a `{\"` object, which makes this highly distinctive).\n\t/\\beyJ[A-Za-z0-9_-]+\\.eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+/g,\n\t// Authorization-header substrings: `Bearer <token>`, `Basic <token>`, `Token <token>`\n\t/\\b(?:Bearer|Basic|Token)\\s+[A-Za-z0-9._~+/=-]{12,}/gi,\n\t// OpenAI / Anthropic API keys\n\t/\\bsk-(?:ant-|proj-)?[A-Za-z0-9_-]{16,}/g,\n\t// Stripe secret/restricted/publishable keys (`sk_live_…`, `rk_test_…`, …)\n\t/\\b(?:sk|rk|pk)_(?:live|test)_[A-Za-z0-9]{16,}/g,\n\t// Google API keys\n\t/\\bAIza[0-9A-Za-z_-]{35}\\b/g,\n\t// Slack tokens (xoxb, xoxp, xoxa, xoxr, xoxs, xoxo)\n\t/\\bxox[abprso]-[A-Za-z0-9-]{10,}/g,\n\t// GitHub tokens (ghp, ghs, gho, ghr, ghu)\n\t/\\bgh[psoru]_[A-Za-z0-9]{20,}/g,\n\t// GitHub fine-grained personal access tokens\n\t/\\bgithub_pat_[A-Za-z0-9_]{22,}/g,\n\t// AWS access key id\n\t/\\bAKIA[0-9A-Z]{16}\\b/g,\n\t// Credentials embedded in a URL: `scheme://user:password@` — redact the userinfo.\n\t/(?<=:\\/\\/)[^\\s:/@]+:[^\\s:/@]+(?=@)/g,\n\t// JSON-shaped `\"key\": \"value\"` — matches the quoted field as a whole.\n\t// Run before the loose pattern so nested objects like\n\t// `{\"credentials\": {\"apiKey\": \"...\"}}` don't have the outer key consume\n\t// the inner key on its way to a non-quoted (object) value. The value\n\t// body uses the standard JSON-string idiom `(?:\\\\.|[^\"\\r\\n])*` so an\n\t// escaped quote inside the value (`\"abc\\\"def\"`) doesn't end the match\n\t// early and leak the rest of the secret. The negative lookahead skips\n\t// values that are already a `[redacted]` / `[REDACTED]` placeholder so\n\t// this stays idempotent when chained behind upstream object-walking\n\t// redaction (e.g. langsmith trace payloads).\n\tnew RegExp(\n\t\t`\"(?:${SECRET_KEYS})\"\\\\s*:\\\\s*\"(?!\\\\[(?:redacted|REDACTED)\\\\]\")(?:\\\\\\\\.|[^\"\\\\r\\\\n])*\"`,\n\t\t'gi',\n\t),\n\t// JS-object-shaped `'key': 'value'`\n\tnew RegExp(\n\t\t`'(?:${SECRET_KEYS})'\\\\s*:\\\\s*'(?!\\\\[(?:redacted|REDACTED)\\\\]')(?:\\\\\\\\.|[^'\\\\r\\\\n])*'`,\n\t\t'gi',\n\t),\n\t// Generic `password=...` / `api_key=...` / `secret=...` style assignments\n\tnew RegExp(`\\\\b(?:${SECRET_KEYS})\\\\s*[:=]\\\\s*\\\\S+`, 'gi'),\n];\n\nexport function scrubSecretsInText(input: string): string {\n\tlet out = input;\n\tfor (const pattern of SECRET_VALUE_PATTERNS) {\n\t\tout = out.replace(pattern, '[REDACTED]');\n\t}\n\treturn out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAa,cACZ;AAED,MAAaA,wBAA2C;CAEvD;CAGA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAWA,IAAI,OACH,OAAO,YAAY,qEACnB,KACA;CAED,IAAI,OACH,OAAO,YAAY,qEACnB,KACA;CAED,IAAI,OAAO,SAAS,YAAY,oBAAoB,KAAK;CACzD;AAED,SAAgB,mBAAmB,OAAuB;CACzD,IAAI,MAAM;AACV,MAAK,MAAM,WAAW,sBACrB,OAAM,IAAI,QAAQ,SAAS,aAAa;AAEzC,QAAO"}
1
+ {"version":3,"file":"scrub-secrets2.cjs","names":["SECRET_VALUE_PATTERNS: readonly RegExp[]"],"sources":["../src/scrub-secrets.ts"],"sourcesContent":["/**\n * Replace common credential patterns in free-form text with `[REDACTED]`.\n *\n * Used before persisting or transmitting user-supplied text (telemetry\n * excerpts, eval report HTML, free-form feedback) where keys/tokens\n * accidentally pasted into prompts or command lines could otherwise leak\n * downstream.\n *\n * Conservative by design: matches well-known prefixed tokens, explicit\n * `key=value` pairs, and quoted JSON/JS-object fields with sensitive\n * names. We don't attempt to redact arbitrary long opaque strings — false\n * positives on file paths, IDs, or base64 payloads would make the output\n * unreadable.\n */\nexport const SECRET_KEYS =\n\t'password|passwd|secret|credentials?|api[_-]?key|authorization|access[_-]?token|refresh[_-]?token|id[_-]?token|session[_-]?token|auth[_-]?token';\n\nexport const SECRET_VALUE_PATTERNS: readonly RegExp[] = [\n\t// PEM private-key blocks (RSA/EC/DSA/OpenSSH/PGP). Whole block, multiline.\n\t/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----[\\s\\S]*?-----END (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/g,\n\t// JWTs: `eyJ<header>.eyJ<payload>.<signature>` (both leading segments are\n\t// base64url of a `{\"` object, which makes this highly distinctive).\n\t/\\beyJ[A-Za-z0-9_-]+\\.eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+/g,\n\t// Authorization-header substrings: `Bearer <token>`, `Basic <token>`, `Token <token>`\n\t/\\b(?:Bearer|Basic|Token)\\s+[A-Za-z0-9._~+/=-]{12,}/gi,\n\t// OpenAI / Anthropic API keys\n\t/\\bsk-(?:ant-|proj-)?[A-Za-z0-9_-]{16,}/g,\n\t// Stripe secret/restricted/publishable keys (`sk_live_…`, `rk_test_…`, …)\n\t/\\b(?:sk|rk|pk)_(?:live|test)_[A-Za-z0-9]{16,}/g,\n\t// Google API keys\n\t/\\bAIza[0-9A-Za-z_-]{35}\\b/g,\n\t// Slack tokens (xoxb, xoxp, xoxa, xoxr, xoxs, xoxo)\n\t/\\bxox[abprso]-[A-Za-z0-9-]{10,}/g,\n\t// GitHub tokens (ghp, ghs, gho, ghr, ghu)\n\t/\\bgh[psoru]_[A-Za-z0-9]{20,}/g,\n\t// GitHub fine-grained personal access tokens\n\t/\\bgithub_pat_[A-Za-z0-9_]{22,}/g,\n\t// AWS access key id\n\t/\\bAKIA[0-9A-Z]{16}\\b/g,\n\t// Credentials embedded in a URL: `scheme://user:password@` — redact the userinfo.\n\t/(?<=:\\/\\/)[^\\s:/@]+:[^\\s:/@]+(?=@)/g,\n\t// JSON-shaped `\"key\": \"value\"` — matches the quoted field as a whole.\n\t// Run before the loose pattern so nested objects like\n\t// `{\"credentials\": {\"apiKey\": \"...\"}}` don't have the outer key consume\n\t// the inner key on its way to a non-quoted (object) value. The value\n\t// body uses the standard JSON-string idiom `(?:\\\\.|[^\"\\r\\n])*` so an\n\t// escaped quote inside the value (`\"abc\\\"def\"`) doesn't end the match\n\t// early and leak the rest of the secret. The negative lookahead skips\n\t// values that are already a `[redacted]` / `[REDACTED]` / typed\n\t// `[REDACTED:<type>:<index>]` placeholder so this stays idempotent when\n\t// chained behind upstream object-walking redaction (langsmith trace\n\t// payloads, mcp-browser markers).\n\tnew RegExp(\n\t\t`\"(?:${SECRET_KEYS})\"\\\\s*:\\\\s*\"(?!\\\\[(?:redacted|REDACTED)(?::[^\"\\\\]]*)?\\\\]\")(?:\\\\\\\\.|[^\"\\\\r\\\\n])*\"`,\n\t\t'gi',\n\t),\n\t// JS-object-shaped `'key': 'value'`\n\tnew RegExp(\n\t\t`'(?:${SECRET_KEYS})'\\\\s*:\\\\s*'(?!\\\\[(?:redacted|REDACTED)(?::[^'\\\\]]*)?\\\\]')(?:\\\\\\\\.|[^'\\\\r\\\\n])*'`,\n\t\t'gi',\n\t),\n\t// Generic `password=...` / `api_key=...` / `secret=...` style assignments.\n\t// The negative lookbehind skips a keyword sitting at the `<type>` position of\n\t// an upstream `[REDACTED:<type>:<index>]` marker (e.g. mcp-browser output), so\n\t// the `secret:1]` tail isn't re-matched into a nested `[REDACTED:[REDACTED]`.\n\t// Checking only the `[REDACTED:` prefix suffices: inside a marker a keyword can\n\t// only start a `\\b` match right after that prefix — every other keyword-shaped\n\t// substring is preceded by `_` (snake_case type slug) or a digit, so no word\n\t// boundary opens there.\n\tnew RegExp(`(?<!\\\\[(?:redacted|REDACTED):)\\\\b(?:${SECRET_KEYS})\\\\s*[:=]\\\\s*\\\\S+`, 'gi'),\n];\n\nexport function scrubSecretsInText(input: string): string {\n\tlet out = input;\n\tfor (const pattern of SECRET_VALUE_PATTERNS) {\n\t\tout = out.replace(pattern, '[REDACTED]');\n\t}\n\treturn out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAa,cACZ;AAED,MAAaA,wBAA2C;CAEvD;CAGA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAYA,IAAI,OACH,OAAO,YAAY,mFACnB,KACA;CAED,IAAI,OACH,OAAO,YAAY,mFACnB,KACA;CASD,IAAI,OAAO,uCAAuC,YAAY,oBAAoB,KAAK;CACvF;AAED,SAAgB,mBAAmB,OAAuB;CACzD,IAAI,MAAM;AACV,MAAK,MAAM,WAAW,sBACrB,OAAM,IAAI,QAAQ,SAAS,aAAa;AAEzC,QAAO"}
@@ -26,9 +26,9 @@ const SECRET_VALUE_PATTERNS = [
26
26
  /\bgithub_pat_[A-Za-z0-9_]{22,}/g,
27
27
  /\bAKIA[0-9A-Z]{16}\b/g,
28
28
  /(?<=:\/\/)[^\s:/@]+:[^\s:/@]+(?=@)/g,
29
- new RegExp(`"(?:${SECRET_KEYS})"\\s*:\\s*"(?!\\[(?:redacted|REDACTED)\\]")(?:\\\\.|[^"\\r\\n])*"`, "gi"),
30
- new RegExp(`'(?:${SECRET_KEYS})'\\s*:\\s*'(?!\\[(?:redacted|REDACTED)\\]')(?:\\\\.|[^'\\r\\n])*'`, "gi"),
31
- new RegExp(`\\b(?:${SECRET_KEYS})\\s*[:=]\\s*\\S+`, "gi")
29
+ new RegExp(`"(?:${SECRET_KEYS})"\\s*:\\s*"(?!\\[(?:redacted|REDACTED)(?::[^"\\]]*)?\\]")(?:\\\\.|[^"\\r\\n])*"`, "gi"),
30
+ new RegExp(`'(?:${SECRET_KEYS})'\\s*:\\s*'(?!\\[(?:redacted|REDACTED)(?::[^'\\]]*)?\\]')(?:\\\\.|[^'\\r\\n])*'`, "gi"),
31
+ new RegExp(`(?<!\\[(?:redacted|REDACTED):)\\b(?:${SECRET_KEYS})\\s*[:=]\\s*\\S+`, "gi")
32
32
  ];
33
33
  function scrubSecretsInText(input) {
34
34
  let out = input;
@@ -1 +1 @@
1
- {"version":3,"file":"scrub-secrets2.mjs","names":["SECRET_VALUE_PATTERNS: readonly RegExp[]"],"sources":["../src/scrub-secrets.ts"],"sourcesContent":["/**\n * Replace common credential patterns in free-form text with `[REDACTED]`.\n *\n * Used before persisting or transmitting user-supplied text (telemetry\n * excerpts, eval report HTML, free-form feedback) where keys/tokens\n * accidentally pasted into prompts or command lines could otherwise leak\n * downstream.\n *\n * Conservative by design: matches well-known prefixed tokens, explicit\n * `key=value` pairs, and quoted JSON/JS-object fields with sensitive\n * names. We don't attempt to redact arbitrary long opaque strings — false\n * positives on file paths, IDs, or base64 payloads would make the output\n * unreadable.\n */\nexport const SECRET_KEYS =\n\t'password|passwd|secret|credentials?|api[_-]?key|authorization|access[_-]?token|refresh[_-]?token|id[_-]?token|session[_-]?token|auth[_-]?token';\n\nexport const SECRET_VALUE_PATTERNS: readonly RegExp[] = [\n\t// PEM private-key blocks (RSA/EC/DSA/OpenSSH/PGP). Whole block, multiline.\n\t/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----[\\s\\S]*?-----END (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/g,\n\t// JWTs: `eyJ<header>.eyJ<payload>.<signature>` (both leading segments are\n\t// base64url of a `{\"` object, which makes this highly distinctive).\n\t/\\beyJ[A-Za-z0-9_-]+\\.eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+/g,\n\t// Authorization-header substrings: `Bearer <token>`, `Basic <token>`, `Token <token>`\n\t/\\b(?:Bearer|Basic|Token)\\s+[A-Za-z0-9._~+/=-]{12,}/gi,\n\t// OpenAI / Anthropic API keys\n\t/\\bsk-(?:ant-|proj-)?[A-Za-z0-9_-]{16,}/g,\n\t// Stripe secret/restricted/publishable keys (`sk_live_…`, `rk_test_…`, …)\n\t/\\b(?:sk|rk|pk)_(?:live|test)_[A-Za-z0-9]{16,}/g,\n\t// Google API keys\n\t/\\bAIza[0-9A-Za-z_-]{35}\\b/g,\n\t// Slack tokens (xoxb, xoxp, xoxa, xoxr, xoxs, xoxo)\n\t/\\bxox[abprso]-[A-Za-z0-9-]{10,}/g,\n\t// GitHub tokens (ghp, ghs, gho, ghr, ghu)\n\t/\\bgh[psoru]_[A-Za-z0-9]{20,}/g,\n\t// GitHub fine-grained personal access tokens\n\t/\\bgithub_pat_[A-Za-z0-9_]{22,}/g,\n\t// AWS access key id\n\t/\\bAKIA[0-9A-Z]{16}\\b/g,\n\t// Credentials embedded in a URL: `scheme://user:password@` — redact the userinfo.\n\t/(?<=:\\/\\/)[^\\s:/@]+:[^\\s:/@]+(?=@)/g,\n\t// JSON-shaped `\"key\": \"value\"` — matches the quoted field as a whole.\n\t// Run before the loose pattern so nested objects like\n\t// `{\"credentials\": {\"apiKey\": \"...\"}}` don't have the outer key consume\n\t// the inner key on its way to a non-quoted (object) value. The value\n\t// body uses the standard JSON-string idiom `(?:\\\\.|[^\"\\r\\n])*` so an\n\t// escaped quote inside the value (`\"abc\\\"def\"`) doesn't end the match\n\t// early and leak the rest of the secret. The negative lookahead skips\n\t// values that are already a `[redacted]` / `[REDACTED]` placeholder so\n\t// this stays idempotent when chained behind upstream object-walking\n\t// redaction (e.g. langsmith trace payloads).\n\tnew RegExp(\n\t\t`\"(?:${SECRET_KEYS})\"\\\\s*:\\\\s*\"(?!\\\\[(?:redacted|REDACTED)\\\\]\")(?:\\\\\\\\.|[^\"\\\\r\\\\n])*\"`,\n\t\t'gi',\n\t),\n\t// JS-object-shaped `'key': 'value'`\n\tnew RegExp(\n\t\t`'(?:${SECRET_KEYS})'\\\\s*:\\\\s*'(?!\\\\[(?:redacted|REDACTED)\\\\]')(?:\\\\\\\\.|[^'\\\\r\\\\n])*'`,\n\t\t'gi',\n\t),\n\t// Generic `password=...` / `api_key=...` / `secret=...` style assignments\n\tnew RegExp(`\\\\b(?:${SECRET_KEYS})\\\\s*[:=]\\\\s*\\\\S+`, 'gi'),\n];\n\nexport function scrubSecretsInText(input: string): string {\n\tlet out = input;\n\tfor (const pattern of SECRET_VALUE_PATTERNS) {\n\t\tout = out.replace(pattern, '[REDACTED]');\n\t}\n\treturn out;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,cACZ;AAED,MAAaA,wBAA2C;CAEvD;CAGA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAWA,IAAI,OACH,OAAO,YAAY,qEACnB,KACA;CAED,IAAI,OACH,OAAO,YAAY,qEACnB,KACA;CAED,IAAI,OAAO,SAAS,YAAY,oBAAoB,KAAK;CACzD;AAED,SAAgB,mBAAmB,OAAuB;CACzD,IAAI,MAAM;AACV,MAAK,MAAM,WAAW,sBACrB,OAAM,IAAI,QAAQ,SAAS,aAAa;AAEzC,QAAO"}
1
+ {"version":3,"file":"scrub-secrets2.mjs","names":["SECRET_VALUE_PATTERNS: readonly RegExp[]"],"sources":["../src/scrub-secrets.ts"],"sourcesContent":["/**\n * Replace common credential patterns in free-form text with `[REDACTED]`.\n *\n * Used before persisting or transmitting user-supplied text (telemetry\n * excerpts, eval report HTML, free-form feedback) where keys/tokens\n * accidentally pasted into prompts or command lines could otherwise leak\n * downstream.\n *\n * Conservative by design: matches well-known prefixed tokens, explicit\n * `key=value` pairs, and quoted JSON/JS-object fields with sensitive\n * names. We don't attempt to redact arbitrary long opaque strings — false\n * positives on file paths, IDs, or base64 payloads would make the output\n * unreadable.\n */\nexport const SECRET_KEYS =\n\t'password|passwd|secret|credentials?|api[_-]?key|authorization|access[_-]?token|refresh[_-]?token|id[_-]?token|session[_-]?token|auth[_-]?token';\n\nexport const SECRET_VALUE_PATTERNS: readonly RegExp[] = [\n\t// PEM private-key blocks (RSA/EC/DSA/OpenSSH/PGP). Whole block, multiline.\n\t/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----[\\s\\S]*?-----END (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/g,\n\t// JWTs: `eyJ<header>.eyJ<payload>.<signature>` (both leading segments are\n\t// base64url of a `{\"` object, which makes this highly distinctive).\n\t/\\beyJ[A-Za-z0-9_-]+\\.eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+/g,\n\t// Authorization-header substrings: `Bearer <token>`, `Basic <token>`, `Token <token>`\n\t/\\b(?:Bearer|Basic|Token)\\s+[A-Za-z0-9._~+/=-]{12,}/gi,\n\t// OpenAI / Anthropic API keys\n\t/\\bsk-(?:ant-|proj-)?[A-Za-z0-9_-]{16,}/g,\n\t// Stripe secret/restricted/publishable keys (`sk_live_…`, `rk_test_…`, …)\n\t/\\b(?:sk|rk|pk)_(?:live|test)_[A-Za-z0-9]{16,}/g,\n\t// Google API keys\n\t/\\bAIza[0-9A-Za-z_-]{35}\\b/g,\n\t// Slack tokens (xoxb, xoxp, xoxa, xoxr, xoxs, xoxo)\n\t/\\bxox[abprso]-[A-Za-z0-9-]{10,}/g,\n\t// GitHub tokens (ghp, ghs, gho, ghr, ghu)\n\t/\\bgh[psoru]_[A-Za-z0-9]{20,}/g,\n\t// GitHub fine-grained personal access tokens\n\t/\\bgithub_pat_[A-Za-z0-9_]{22,}/g,\n\t// AWS access key id\n\t/\\bAKIA[0-9A-Z]{16}\\b/g,\n\t// Credentials embedded in a URL: `scheme://user:password@` — redact the userinfo.\n\t/(?<=:\\/\\/)[^\\s:/@]+:[^\\s:/@]+(?=@)/g,\n\t// JSON-shaped `\"key\": \"value\"` — matches the quoted field as a whole.\n\t// Run before the loose pattern so nested objects like\n\t// `{\"credentials\": {\"apiKey\": \"...\"}}` don't have the outer key consume\n\t// the inner key on its way to a non-quoted (object) value. The value\n\t// body uses the standard JSON-string idiom `(?:\\\\.|[^\"\\r\\n])*` so an\n\t// escaped quote inside the value (`\"abc\\\"def\"`) doesn't end the match\n\t// early and leak the rest of the secret. The negative lookahead skips\n\t// values that are already a `[redacted]` / `[REDACTED]` / typed\n\t// `[REDACTED:<type>:<index>]` placeholder so this stays idempotent when\n\t// chained behind upstream object-walking redaction (langsmith trace\n\t// payloads, mcp-browser markers).\n\tnew RegExp(\n\t\t`\"(?:${SECRET_KEYS})\"\\\\s*:\\\\s*\"(?!\\\\[(?:redacted|REDACTED)(?::[^\"\\\\]]*)?\\\\]\")(?:\\\\\\\\.|[^\"\\\\r\\\\n])*\"`,\n\t\t'gi',\n\t),\n\t// JS-object-shaped `'key': 'value'`\n\tnew RegExp(\n\t\t`'(?:${SECRET_KEYS})'\\\\s*:\\\\s*'(?!\\\\[(?:redacted|REDACTED)(?::[^'\\\\]]*)?\\\\]')(?:\\\\\\\\.|[^'\\\\r\\\\n])*'`,\n\t\t'gi',\n\t),\n\t// Generic `password=...` / `api_key=...` / `secret=...` style assignments.\n\t// The negative lookbehind skips a keyword sitting at the `<type>` position of\n\t// an upstream `[REDACTED:<type>:<index>]` marker (e.g. mcp-browser output), so\n\t// the `secret:1]` tail isn't re-matched into a nested `[REDACTED:[REDACTED]`.\n\t// Checking only the `[REDACTED:` prefix suffices: inside a marker a keyword can\n\t// only start a `\\b` match right after that prefix — every other keyword-shaped\n\t// substring is preceded by `_` (snake_case type slug) or a digit, so no word\n\t// boundary opens there.\n\tnew RegExp(`(?<!\\\\[(?:redacted|REDACTED):)\\\\b(?:${SECRET_KEYS})\\\\s*[:=]\\\\s*\\\\S+`, 'gi'),\n];\n\nexport function scrubSecretsInText(input: string): string {\n\tlet out = input;\n\tfor (const pattern of SECRET_VALUE_PATTERNS) {\n\t\tout = out.replace(pattern, '[REDACTED]');\n\t}\n\treturn out;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,cACZ;AAED,MAAaA,wBAA2C;CAEvD;CAGA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA;CAYA,IAAI,OACH,OAAO,YAAY,mFACnB,KACA;CAED,IAAI,OACH,OAAO,YAAY,mFACnB,KACA;CASD,IAAI,OAAO,uCAAuC,YAAY,oBAAoB,KAAK;CACvF;AAED,SAAgB,mBAAmB,OAAuB;CACzD,IAAI,MAAM;AACV,MAAK,MAAM,WAAW,sBACrB,OAAM,IAAI,QAAQ,SAAS,aAAa;AAEzC,QAAO"}
@@ -0,0 +1,3 @@
1
+ const require_re_rank_search_results = require('../re-rank-search-results.cjs');
2
+
3
+ exports.reRankSearchResults = require_re_rank_search_results.reRankSearchResults;
@@ -0,0 +1,2 @@
1
+ import { t as reRankSearchResults } from "../re-rank-search-results.cjs";
2
+ export { reRankSearchResults };
@@ -0,0 +1,2 @@
1
+ import { t as reRankSearchResults } from "../re-rank-search-results.mjs";
2
+ export { reRankSearchResults };
@@ -0,0 +1,3 @@
1
+ import { t as reRankSearchResults } from "../re-rank-search-results.mjs";
2
+
3
+ export { reRankSearchResults };
@@ -0,0 +1,4 @@
1
+ const require_sublime_search = require('../sublime-search.cjs');
2
+
3
+ exports.DEFAULT_KEYS = require_sublime_search.DEFAULT_KEYS;
4
+ exports.sublimeSearch = require_sublime_search.sublimeSearch;
@@ -1,2 +1,2 @@
1
- import { n as sublimeSearch, t as DEFAULT_KEYS } from "../sublimeSearch.cjs";
1
+ import { n as sublimeSearch, t as DEFAULT_KEYS } from "../sublime-search.cjs";
2
2
  export { DEFAULT_KEYS, sublimeSearch };
@@ -1,2 +1,2 @@
1
- import { n as sublimeSearch, t as DEFAULT_KEYS } from "../sublimeSearch.mjs";
1
+ import { n as sublimeSearch, t as DEFAULT_KEYS } from "../sublime-search.mjs";
2
2
  export { DEFAULT_KEYS, sublimeSearch };
@@ -1,3 +1,3 @@
1
- import { n as sublimeSearch, t as DEFAULT_KEYS } from "../sublimeSearch.mjs";
1
+ import { n as sublimeSearch, t as DEFAULT_KEYS } from "../sublime-search.mjs";
2
2
 
3
3
  export { DEFAULT_KEYS, sublimeSearch };
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/number/smartDecimal.ts
2
+ //#region src/number/smart-decimal.ts
3
3
  const smartDecimal = (value, decimals = 2) => {
4
4
  if (Number.isInteger(value)) return value;
5
5
  if (value.toString().split(".")[1].length <= decimals) return value;
@@ -13,4 +13,4 @@ Object.defineProperty(exports, 'smartDecimal', {
13
13
  return smartDecimal;
14
14
  }
15
15
  });
16
- //# sourceMappingURL=smartDecimal.cjs.map
16
+ //# sourceMappingURL=smart-decimal.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smart-decimal.cjs","names":[],"sources":["../src/number/smart-decimal.ts"],"sourcesContent":["export const smartDecimal = (value: number, decimals = 2): number => {\n\t// Check if integer\n\tif (Number.isInteger(value)) {\n\t\treturn value;\n\t}\n\n\t// Check if it has only one decimal place\n\tif (value.toString().split('.')[1].length <= decimals) {\n\t\treturn value;\n\t}\n\n\treturn Number(value.toFixed(decimals));\n};\n"],"mappings":";;AAAA,MAAa,gBAAgB,OAAe,WAAW,MAAc;AAEpE,KAAI,OAAO,UAAU,MAAM,CAC1B,QAAO;AAIR,KAAI,MAAM,UAAU,CAAC,MAAM,IAAI,CAAC,GAAG,UAAU,SAC5C,QAAO;AAGR,QAAO,OAAO,MAAM,QAAQ,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
- //#region src/number/smartDecimal.d.ts
1
+ //#region src/number/smart-decimal.d.ts
2
2
  declare const smartDecimal: (value: number, decimals?: number) => number;
3
3
  //#endregion
4
4
  export { smartDecimal as t };
5
- //# sourceMappingURL=smartDecimal.d.cts.map
5
+ //# sourceMappingURL=smart-decimal.d.cts.map
@@ -1,5 +1,5 @@
1
- //#region src/number/smartDecimal.d.ts
1
+ //#region src/number/smart-decimal.d.ts
2
2
  declare const smartDecimal: (value: number, decimals?: number) => number;
3
3
  //#endregion
4
4
  export { smartDecimal as t };
5
- //# sourceMappingURL=smartDecimal.d.mts.map
5
+ //# sourceMappingURL=smart-decimal.d.mts.map
@@ -1,4 +1,4 @@
1
- //#region src/number/smartDecimal.ts
1
+ //#region src/number/smart-decimal.ts
2
2
  const smartDecimal = (value, decimals = 2) => {
3
3
  if (Number.isInteger(value)) return value;
4
4
  if (value.toString().split(".")[1].length <= decimals) return value;
@@ -7,4 +7,4 @@ const smartDecimal = (value, decimals = 2) => {
7
7
 
8
8
  //#endregion
9
9
  export { smartDecimal as t };
10
- //# sourceMappingURL=smartDecimal.mjs.map
10
+ //# sourceMappingURL=smart-decimal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smart-decimal.mjs","names":[],"sources":["../src/number/smart-decimal.ts"],"sourcesContent":["export const smartDecimal = (value: number, decimals = 2): number => {\n\t// Check if integer\n\tif (Number.isInteger(value)) {\n\t\treturn value;\n\t}\n\n\t// Check if it has only one decimal place\n\tif (value.toString().split('.')[1].length <= decimals) {\n\t\treturn value;\n\t}\n\n\treturn Number(value.toFixed(decimals));\n};\n"],"mappings":";AAAA,MAAa,gBAAgB,OAAe,WAAW,MAAc;AAEpE,KAAI,OAAO,UAAU,MAAM,CAC1B,QAAO;AAIR,KAAI,MAAM,UAAU,CAAC,MAAM,IAAI,CAAC,GAAG,UAAU,SAC5C,QAAO;AAGR,QAAO,OAAO,MAAM,QAAQ,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ const require_sort_by_property = require('../sort-by-property.cjs');
2
+
3
+ exports.sortByProperty = require_sort_by_property.sortByProperty;
@@ -0,0 +1,2 @@
1
+ import { t as sortByProperty } from "../sort-by-property.cjs";
2
+ export { sortByProperty };
@@ -0,0 +1,2 @@
1
+ import { t as sortByProperty } from "../sort-by-property.mjs";
2
+ export { sortByProperty };
@@ -0,0 +1,3 @@
1
+ import { t as sortByProperty } from "../sort-by-property.mjs";
2
+
3
+ export { sortByProperty };
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/sort/sortByProperty.ts
2
+ //#region src/sort/sort-by-property.ts
3
3
  const sortByProperty = (property, arr, order = "asc") => arr.sort((a, b) => {
4
4
  const result = String(a[property]).localeCompare(String(b[property]), void 0, {
5
5
  numeric: true,
@@ -15,4 +15,4 @@ Object.defineProperty(exports, 'sortByProperty', {
15
15
  return sortByProperty;
16
16
  }
17
17
  });
18
- //# sourceMappingURL=sortByProperty.cjs.map
18
+ //# sourceMappingURL=sort-by-property.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-by-property.cjs","names":[],"sources":["../src/sort/sort-by-property.ts"],"sourcesContent":["export const sortByProperty = <T>(\n\tproperty: keyof T,\n\tarr: T[],\n\torder: 'asc' | 'desc' = 'asc',\n): T[] =>\n\tarr.sort((a, b) => {\n\t\tconst result = String(a[property]).localeCompare(String(b[property]), undefined, {\n\t\t\tnumeric: true,\n\t\t\tsensitivity: 'base',\n\t\t});\n\t\treturn order === 'asc' ? result : -result;\n\t});\n"],"mappings":";;AAAA,MAAa,kBACZ,UACA,KACA,QAAwB,UAExB,IAAI,MAAM,GAAG,MAAM;CAClB,MAAM,SAAS,OAAO,EAAE,UAAU,CAAC,cAAc,OAAO,EAAE,UAAU,EAAE,QAAW;EAChF,SAAS;EACT,aAAa;EACb,CAAC;AACF,QAAO,UAAU,QAAQ,SAAS,CAAC;EAClC"}
@@ -1,5 +1,5 @@
1
- //#region src/sort/sortByProperty.d.ts
1
+ //#region src/sort/sort-by-property.d.ts
2
2
  declare const sortByProperty: <T>(property: keyof T, arr: T[], order?: "asc" | "desc") => T[];
3
3
  //#endregion
4
4
  export { sortByProperty as t };
5
- //# sourceMappingURL=sortByProperty.d.cts.map
5
+ //# sourceMappingURL=sort-by-property.d.cts.map
@@ -1,5 +1,5 @@
1
- //#region src/sort/sortByProperty.d.ts
1
+ //#region src/sort/sort-by-property.d.ts
2
2
  declare const sortByProperty: <T>(property: keyof T, arr: T[], order?: "asc" | "desc") => T[];
3
3
  //#endregion
4
4
  export { sortByProperty as t };
5
- //# sourceMappingURL=sortByProperty.d.mts.map
5
+ //# sourceMappingURL=sort-by-property.d.mts.map
@@ -1,4 +1,4 @@
1
- //#region src/sort/sortByProperty.ts
1
+ //#region src/sort/sort-by-property.ts
2
2
  const sortByProperty = (property, arr, order = "asc") => arr.sort((a, b) => {
3
3
  const result = String(a[property]).localeCompare(String(b[property]), void 0, {
4
4
  numeric: true,
@@ -9,4 +9,4 @@ const sortByProperty = (property, arr, order = "asc") => arr.sort((a, b) => {
9
9
 
10
10
  //#endregion
11
11
  export { sortByProperty as t };
12
- //# sourceMappingURL=sortByProperty.mjs.map
12
+ //# sourceMappingURL=sort-by-property.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-by-property.mjs","names":[],"sources":["../src/sort/sort-by-property.ts"],"sourcesContent":["export const sortByProperty = <T>(\n\tproperty: keyof T,\n\tarr: T[],\n\torder: 'asc' | 'desc' = 'asc',\n): T[] =>\n\tarr.sort((a, b) => {\n\t\tconst result = String(a[property]).localeCompare(String(b[property]), undefined, {\n\t\t\tnumeric: true,\n\t\t\tsensitivity: 'base',\n\t\t});\n\t\treturn order === 'asc' ? result : -result;\n\t});\n"],"mappings":";AAAA,MAAa,kBACZ,UACA,KACA,QAAwB,UAExB,IAAI,MAAM,GAAG,MAAM;CAClB,MAAM,SAAS,OAAO,EAAE,UAAU,CAAC,cAAc,OAAO,EAAE,UAAU,EAAE,QAAW;EAChF,SAAS;EACT,aAAa;EACb,CAAC;AACF,QAAO,UAAU,QAAQ,SAAS,CAAC;EAClC"}
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/search/sublimeSearch.ts
2
+ //#region src/search/sublime-search.ts
3
3
  const SEQUENTIAL_BONUS = 60;
4
4
  const SEPARATOR_BONUS = 38;
5
5
  const CAMEL_BONUS = 30;
@@ -190,4 +190,4 @@ Object.defineProperty(exports, 'sublimeSearch', {
190
190
  return sublimeSearch;
191
191
  }
192
192
  });
193
- //# sourceMappingURL=sublimeSearch.cjs.map
193
+ //# sourceMappingURL=sublime-search.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sublime-search.cjs","names":["bestRecursiveMatches: number[]","recursiveMatches: number[]","results: Array<{ score: number; item: T }>","itemMatchScore: number | undefined","result: { score: number; item: T }"],"sources":["../src/search/sublime-search.ts"],"sourcesContent":["/*\n * Constants and utility functions used for searching for node types in node creator component\n * based on https://github.com/forrestthewoods/lib_fts/blob/master/code/fts_fuzzy_match.js\n */\n\nconst SEQUENTIAL_BONUS = 60; // bonus for adjacent matches\nconst SEPARATOR_BONUS = 38; // bonus if match occurs after a separator\nconst CAMEL_BONUS = 30; // bonus if match is uppercase and prev is lower\nconst FIRST_LETTER_BONUS = 15; // bonus if the first letter is matched\n\nconst LEADING_LETTER_PENALTY = -20; // penalty applied for every letter in str before the first match\nconst MAX_LEADING_LETTER_PENALTY = -200; // maximum penalty for leading letters\nconst UNMATCHED_LETTER_PENALTY = -2.5;\n\nexport const DEFAULT_KEYS = [\n\t{ key: 'properties.displayName', weight: 1.3 },\n\t{ key: 'properties.codex.alias', weight: 1 },\n];\n\n/**\n * Returns true if each character in pattern is found sequentially within target\n * @param {*} pattern string\n * @param {*} target string\n */\nfunction fuzzyMatchSimple(pattern: string, target: string): boolean {\n\tlet patternIdx = 0;\n\tlet strIdx = 0;\n\n\twhile (patternIdx < pattern.length && strIdx < target.length) {\n\t\tconst patternChar = pattern.charAt(patternIdx).toLowerCase();\n\t\tconst targetChar = target.charAt(strIdx).toLowerCase();\n\t\tif (patternChar === targetChar) {\n\t\t\tpatternIdx++;\n\t\t}\n\t\t++strIdx;\n\t}\n\n\treturn pattern.length !== 0 && target.length !== 0 && patternIdx === pattern.length;\n}\n\nfunction fuzzyMatchRecursive(\n\tpattern: string,\n\ttarget: string,\n\tpatternCurIndex: number,\n\ttargetCurrIndex: number,\n\ttargetMatches: null | number[],\n\tmatches: number[],\n\tmaxMatches: number,\n\tnextMatch: number,\n\trecursionCount: number,\n\trecursionLimit: number,\n): { matched: boolean; outScore: number } {\n\tlet outScore = 0;\n\n\t// Return if recursion limit is reached.\n\tif (++recursionCount >= recursionLimit) {\n\t\treturn { matched: false, outScore };\n\t}\n\n\t// Return if we reached ends of strings.\n\tif (patternCurIndex === pattern.length || targetCurrIndex === target.length) {\n\t\treturn { matched: false, outScore };\n\t}\n\n\t// Recursion params\n\tlet recursiveMatch = false;\n\tlet bestRecursiveMatches: number[] = [];\n\tlet bestRecursiveScore = 0;\n\n\t// Loop through pattern and str looking for a match.\n\tlet firstMatch = true;\n\twhile (patternCurIndex < pattern.length && targetCurrIndex < target.length) {\n\t\t// Match found.\n\t\tif (pattern[patternCurIndex].toLowerCase() === target[targetCurrIndex].toLowerCase()) {\n\t\t\tif (nextMatch >= maxMatches) {\n\t\t\t\treturn { matched: false, outScore };\n\t\t\t}\n\n\t\t\tif (firstMatch && targetMatches) {\n\t\t\t\tmatches = [...targetMatches];\n\t\t\t\tfirstMatch = false;\n\t\t\t}\n\n\t\t\tconst recursiveMatches: number[] = [];\n\t\t\tconst recursiveResult = fuzzyMatchRecursive(\n\t\t\t\tpattern,\n\t\t\t\ttarget,\n\t\t\t\tpatternCurIndex,\n\t\t\t\ttargetCurrIndex + 1,\n\t\t\t\tmatches,\n\t\t\t\trecursiveMatches,\n\t\t\t\tmaxMatches,\n\t\t\t\tnextMatch,\n\t\t\t\trecursionCount,\n\t\t\t\trecursionLimit,\n\t\t\t);\n\n\t\t\tconst recursiveScore = recursiveResult.outScore;\n\t\t\tif (recursiveResult.matched) {\n\t\t\t\t// Pick best recursive score.\n\t\t\t\tif (!recursiveMatch || recursiveScore > bestRecursiveScore) {\n\t\t\t\t\tbestRecursiveMatches = [...recursiveMatches];\n\t\t\t\t\tbestRecursiveScore = recursiveScore;\n\t\t\t\t}\n\t\t\t\trecursiveMatch = true;\n\t\t\t}\n\n\t\t\tmatches[nextMatch++] = targetCurrIndex;\n\t\t\t++patternCurIndex;\n\t\t}\n\t\t++targetCurrIndex;\n\t}\n\n\tconst matched = patternCurIndex === pattern.length;\n\n\tif (matched) {\n\t\toutScore = 100;\n\n\t\t// Apply leading letter penalty (if not n8n-prefixed)\n\t\tif (!target.toLowerCase().startsWith('n8n')) {\n\t\t\tlet penalty = LEADING_LETTER_PENALTY * matches[0];\n\t\t\tpenalty = penalty < MAX_LEADING_LETTER_PENALTY ? MAX_LEADING_LETTER_PENALTY : penalty;\n\t\t\toutScore += penalty;\n\t\t}\n\n\t\t//Apply unmatched penalty\n\t\tconst unmatched = target.length - nextMatch;\n\t\toutScore += UNMATCHED_LETTER_PENALTY * unmatched;\n\n\t\t// Apply ordering bonuses\n\t\tfor (let i = 0; i < nextMatch; i++) {\n\t\t\tconst currIdx = matches[i];\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst prevIdx = matches[i - 1];\n\t\t\t\tif (currIdx === prevIdx + 1) {\n\t\t\t\t\toutScore += SEQUENTIAL_BONUS;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check for bonuses based on neighbor character value.\n\t\t\tif (currIdx > 0) {\n\t\t\t\t// Camel case\n\t\t\t\tconst neighbor = target[currIdx - 1];\n\t\t\t\tconst curr = target[currIdx];\n\t\t\t\tif (neighbor !== neighbor.toUpperCase() && curr !== curr.toLowerCase()) {\n\t\t\t\t\toutScore += CAMEL_BONUS;\n\t\t\t\t}\n\t\t\t\tconst isNeighbourSeparator = neighbor === '_' || neighbor === ' ';\n\t\t\t\tif (isNeighbourSeparator) {\n\t\t\t\t\toutScore += SEPARATOR_BONUS;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// First letter\n\t\t\t\toutScore += FIRST_LETTER_BONUS;\n\t\t\t}\n\t\t}\n\n\t\t// Return best result\n\t\tif (recursiveMatch && (!matched || bestRecursiveScore > outScore)) {\n\t\t\t// Recursive score is better than \"this\"\n\t\t\tmatches = [...bestRecursiveMatches];\n\t\t\toutScore = bestRecursiveScore;\n\t\t\treturn { matched: true, outScore };\n\t\t} else if (matched) {\n\t\t\t// \"this\" score is better than recursive\n\t\t\treturn { matched: true, outScore };\n\t\t} else {\n\t\t\treturn { matched: false, outScore };\n\t\t}\n\t}\n\treturn { matched: false, outScore };\n}\n\n/**\n * Does a fuzzy search to find pattern inside a string.\n * @param {*} pattern string pattern to search for\n * @param {*} target string string which is being searched\n * @returns [boolean, number] a boolean which tells if pattern was\n * found or not and a search score\n */\nfunction fuzzyMatch(pattern: string, target: string): { matched: boolean; outScore: number } {\n\tconst recursionCount = 0;\n\tconst recursionLimit = 5;\n\tconst matches: number[] = [];\n\tconst maxMatches = 256;\n\n\treturn fuzzyMatchRecursive(\n\t\tpattern,\n\t\ttarget,\n\t\t0 /* patternCurIndex */,\n\t\t0 /* strCurrIndex */,\n\t\tnull /* srcMatces */,\n\t\tmatches,\n\t\tmaxMatches,\n\t\t0 /* nextMatch */,\n\t\trecursionCount,\n\t\trecursionLimit,\n\t);\n}\n\n// prop = 'key'\n// prop = 'key1.key2'\n// prop = ['key1', 'key2']\nfunction getValue<T extends object>(obj: T, prop: string): unknown {\n\tif (obj.hasOwnProperty(prop)) {\n\t\treturn obj[prop as keyof T];\n\t}\n\n\tconst segments = prop.split('.');\n\n\tlet result = obj;\n\tlet i = 0;\n\twhile (result && i < segments.length) {\n\t\tconst key = segments[i] as keyof T;\n\t\tresult = result[key] as T;\n\t\ti++;\n\t}\n\treturn result;\n}\n\nfunction scoreSearchValue(filter: string, value: string, weight: number): number | undefined {\n\tif (!fuzzyMatchSimple(filter, value)) return undefined;\n\n\tconst match = fuzzyMatch(filter, value);\n\tif (!match.matched) return undefined;\n\n\treturn match.outScore * weight;\n}\n\nexport function sublimeSearch<T extends object>(\n\tfilter: string,\n\tdata: readonly T[],\n\tkeys: Array<{ key: string; weight: number }> = DEFAULT_KEYS,\n\tlimit?: number,\n): Array<{ score: number; item: T }> {\n\tconst results: Array<{ score: number; item: T }> = [];\n\n\tfor (const item of data) {\n\t\tlet itemMatchScore: number | undefined;\n\n\t\tfor (const { key, weight } of keys) {\n\t\t\tconst value = getValue(item, key);\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const entry of value) {\n\t\t\t\t\tif (typeof entry !== 'string') continue;\n\n\t\t\t\t\tconst score = scoreSearchValue(filter, entry, weight);\n\t\t\t\t\tif (score !== undefined && (itemMatchScore === undefined || score > itemMatchScore)) {\n\t\t\t\t\t\titemMatchScore = score;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (typeof value === 'string') {\n\t\t\t\tconst score = scoreSearchValue(filter, value, weight);\n\t\t\t\tif (score !== undefined && (itemMatchScore === undefined || score > itemMatchScore)) {\n\t\t\t\t\titemMatchScore = score;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (itemMatchScore !== undefined) {\n\t\t\tconst result: { score: number; item: T } = {\n\t\t\t\tscore: itemMatchScore,\n\t\t\t\titem,\n\t\t\t};\n\n\t\t\tif (limit === undefined || results.length < limit) {\n\t\t\t\tresults.push(result);\n\t\t\t} else {\n\t\t\t\tlet lowestIndex = 0;\n\t\t\t\tlet lowestScore = results[0].score;\n\t\t\t\tfor (let i = 1; i < results.length; i++) {\n\t\t\t\t\tif (results[i].score < lowestScore) {\n\t\t\t\t\t\tlowestIndex = i;\n\t\t\t\t\t\tlowestScore = results[i].score;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (result.score > lowestScore) {\n\t\t\t\t\tresults[lowestIndex] = result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tresults.sort((a, b) => {\n\t\treturn b.score - a.score;\n\t});\n\n\treturn results;\n}\n"],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- //#region src/search/sublimeSearch.d.ts
1
+ //#region src/search/sublime-search.d.ts
2
2
  declare const DEFAULT_KEYS: {
3
3
  key: string;
4
4
  weight: number;
@@ -12,4 +12,4 @@ declare function sublimeSearch<T extends object>(filter: string, data: readonly
12
12
  }>;
13
13
  //#endregion
14
14
  export { sublimeSearch as n, DEFAULT_KEYS as t };
15
- //# sourceMappingURL=sublimeSearch.d.cts.map
15
+ //# sourceMappingURL=sublime-search.d.cts.map
@@ -1,4 +1,4 @@
1
- //#region src/search/sublimeSearch.d.ts
1
+ //#region src/search/sublime-search.d.ts
2
2
  declare const DEFAULT_KEYS: {
3
3
  key: string;
4
4
  weight: number;
@@ -12,4 +12,4 @@ declare function sublimeSearch<T extends object>(filter: string, data: readonly
12
12
  }>;
13
13
  //#endregion
14
14
  export { sublimeSearch as n, DEFAULT_KEYS as t };
15
- //# sourceMappingURL=sublimeSearch.d.mts.map
15
+ //# sourceMappingURL=sublime-search.d.mts.map
@@ -1,4 +1,4 @@
1
- //#region src/search/sublimeSearch.ts
1
+ //#region src/search/sublime-search.ts
2
2
  const SEQUENTIAL_BONUS = 60;
3
3
  const SEPARATOR_BONUS = 38;
4
4
  const CAMEL_BONUS = 30;
@@ -178,4 +178,4 @@ function sublimeSearch(filter, data, keys = DEFAULT_KEYS, limit) {
178
178
 
179
179
  //#endregion
180
180
  export { sublimeSearch as n, DEFAULT_KEYS as t };
181
- //# sourceMappingURL=sublimeSearch.mjs.map
181
+ //# sourceMappingURL=sublime-search.mjs.map