Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
🧗 refactor: Replace `traverse` package with Minimal Traversal for Logging (#8687)
Danny Avila97e1cdd224bb
diff --git a/.github/workflows/data-schemas.yml b/.github/workflows/data-schemas.ymlindex fee72fbe02..ee2d9c30d7 100644--- a/.github/workflows/data-schemas.yml+++ b/.github/workflows/data-schemas.yml@@ -22,7 +22,7 @@ jobs:- name: Use Node.jsuses: actions/setup-node@v4with:- node-version: '18.x'+ node-version: '20.x'- name: Install dependenciesrun: cd packages/data-schemas && npm cidiff --git a/package-lock.json b/package-lock.jsonindex d9c3ea5f42..97df522f40 100644--- a/package-lock.json+++ b/package-lock.json@@ -27800,12 +27800,6 @@"resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz","integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA=="},- "node_modules/@types/traverse": {- "version": "0.6.37",- "resolved": "https://registry.npmjs.org/@types/traverse/-/traverse-0.6.37.tgz",- "integrity": "sha512-c90MVeDiUI1FhOZ6rLQ3kDWr50YE8+paDpM+5zbHjbmsqEp2DlMYkqnZnwbK9oI+NvDe8yRajup4jFwnVX6xsA==",- "dev": true- },"node_modules/@types/triple-beam": {"version": "1.3.5","resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz",@@ -28569,6 +28563,7 @@"version": "1.0.2","resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz","integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3",@@ -28716,6 +28711,7 @@"version": "1.0.4","resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz","integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==",+ "dev": true,"license": "MIT","dependencies": {"array-buffer-byte-length": "^1.0.1",@@ -28801,6 +28797,7 @@"version": "1.0.0","resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz","integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==",+ "dev": true,"license": "MIT","engines": {"node": ">= 0.4"@@ -28871,6 +28868,7 @@"version": "1.0.7","resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz","integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==",+ "dev": true,"dependencies": {"possible-typed-array-names": "^1.0.0"},@@ -29559,6 +29557,7 @@"version": "1.0.8","resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz","integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==",+ "dev": true,"license": "MIT","dependencies": {"call-bind-apply-helpers": "^1.0.0",@@ -30835,6 +30834,7 @@"version": "1.0.2","resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz","integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3",@@ -30852,6 +30852,7 @@"version": "1.0.2","resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz","integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3",@@ -30869,6 +30870,7 @@"version": "1.0.1","resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz","integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.2",@@ -31037,6 +31039,7 @@"version": "1.1.4","resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz","integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",+ "dev": true,"dependencies": {"es-define-property": "^1.0.0","es-errors": "^1.3.0",@@ -31065,6 +31068,7 @@"version": "1.2.1","resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz","integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==",+ "dev": true,"dependencies": {"define-data-property": "^1.0.1","has-property-descriptors": "^1.0.0",@@ -31589,6 +31593,7 @@"version": "1.23.9","resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz","integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==",+ "dev": true,"license": "MIT","dependencies": {"array-buffer-byte-length": "^1.0.2",@@ -31767,6 +31772,7 @@"version": "1.3.0","resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz","integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==",+ "dev": true,"license": "MIT","dependencies": {"is-callable": "^1.2.7",@@ -33284,6 +33290,7 @@"version": "0.3.3","resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz","integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",+ "dev": true,"dependencies": {"is-callable": "^1.1.3"}@@ -33491,6 +33498,7 @@"version": "1.1.8","resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz","integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==",+ "dev": true,"license": "MIT","dependencies": {"call-bind": "^1.0.8",@@ -33511,6 +33519,7 @@"version": "1.2.3","resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz","integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",+ "dev": true,"funding": {"url": "https://github.com/sponsors/ljharb"}@@ -33695,6 +33704,7 @@"version": "1.1.0","resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz","integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3",@@ -33797,6 +33807,7 @@"version": "1.0.4","resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz","integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==",+ "dev": true,"license": "MIT","dependencies": {"define-properties": "^1.2.1",@@ -34019,6 +34030,7 @@"version": "1.0.2","resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz","integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==",+ "dev": true,"funding": {"url": "https://github.com/sponsors/ljharb"}@@ -34035,6 +34047,7 @@"version": "1.0.2","resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz","integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",+ "dev": true,"dependencies": {"es-define-property": "^1.0.0"},@@ -34046,6 +34059,7 @@"version": "1.2.0","resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz","integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==",+ "dev": true,"license": "MIT","dependencies": {"dunder-proto": "^1.0.0"@@ -34830,6 +34844,7 @@"version": "1.1.0","resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz","integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==",+ "dev": true,"license": "MIT","dependencies": {"es-errors": "^1.3.0",@@ -34947,6 +34962,7 @@"version": "3.0.5","resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz","integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==",+ "dev": true,"license": "MIT","dependencies": {"call-bind": "^1.0.8",@@ -34970,6 +34986,7 @@"version": "2.1.1","resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz","integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==",+ "dev": true,"license": "MIT","dependencies": {"async-function": "^1.0.0",@@ -34989,6 +35006,7 @@"version": "1.1.0","resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz","integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==",+ "dev": true,"license": "MIT","dependencies": {"has-bigints": "^1.0.2"@@ -35015,6 +35033,7 @@"version": "1.2.2","resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz","integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3",@@ -35056,6 +35075,7 @@"version": "1.2.7","resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz","integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",+ "dev": true,"engines": {"node": ">= 0.4"},@@ -35082,6 +35102,7 @@"version": "1.0.2","resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz","integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.2",@@ -35099,6 +35120,7 @@"version": "1.1.0","resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz","integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.2",@@ -35147,6 +35169,7 @@"version": "1.1.1","resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz","integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3"@@ -35184,6 +35207,7 @@"version": "1.0.10","resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz","integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==",+ "dev": true,"dependencies": {"has-tostringtag": "^1.0.0"},@@ -35236,6 +35260,7 @@"version": "2.0.3","resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz","integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==",+ "dev": true,"license": "MIT","engines": {"node": ">= 0.4"@@ -35278,6 +35303,7 @@"version": "1.1.1","resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz","integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3",@@ -35343,6 +35369,7 @@"version": "1.2.1","resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz","integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.2",@@ -35370,6 +35397,7 @@"version": "2.0.3","resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz","integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==",+ "dev": true,"license": "MIT","engines": {"node": ">= 0.4"@@ -35382,6 +35410,7 @@"version": "1.0.4","resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz","integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3"@@ -35408,6 +35437,7 @@"version": "1.1.1","resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz","integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3",@@ -35424,6 +35454,7 @@"version": "1.1.1","resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz","integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.2",@@ -35441,6 +35472,7 @@"version": "1.1.15","resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz","integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==",+ "dev": true,"license": "MIT","dependencies": {"which-typed-array": "^1.1.16"@@ -35456,6 +35488,7 @@"version": "2.0.2","resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz","integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==",+ "dev": true,"license": "MIT","engines": {"node": ">= 0.4"@@ -35468,6 +35501,7 @@"version": "1.1.1","resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz","integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3"@@ -35483,6 +35517,7 @@"version": "2.0.4","resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz","integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3",@@ -39939,6 +39974,7 @@"version": "1.1.1","resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz","integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",+ "dev": true,"engines": {"node": ">= 0.4"}@@ -39947,6 +39983,7 @@"version": "4.1.7","resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz","integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==",+ "dev": true,"license": "MIT","dependencies": {"call-bind": "^1.0.8",@@ -40183,6 +40220,7 @@"version": "1.0.1","resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz","integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==",+ "dev": true,"license": "MIT","dependencies": {"get-intrinsic": "^1.2.6",@@ -40859,6 +40897,7 @@"version": "1.0.0","resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz","integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==",+ "dev": true,"engines": {"node": ">= 0.4"}@@ -43110,6 +43149,7 @@"version": "1.0.10","resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz","integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==",+ "dev": true,"license": "MIT","dependencies": {"call-bind": "^1.0.8",@@ -43166,6 +43206,7 @@"version": "1.5.4","resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz","integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==",+ "dev": true,"license": "MIT","dependencies": {"call-bind": "^1.0.8",@@ -44239,6 +44280,7 @@"version": "1.1.3","resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz","integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==",+ "dev": true,"license": "MIT","dependencies": {"call-bind": "^1.0.8",@@ -44258,6 +44300,7 @@"version": "2.0.5","resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz","integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",+ "dev": true,"license": "MIT"},"node_modules/safe-buffer": {@@ -44283,6 +44326,7 @@"version": "1.0.0","resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz","integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==",+ "dev": true,"license": "MIT","dependencies": {"es-errors": "^1.3.0",@@ -44299,12 +44343,14 @@"version": "2.0.5","resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz","integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",+ "dev": true,"license": "MIT"},"node_modules/safe-regex-test": {"version": "1.1.0","resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz","integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.2",@@ -44468,6 +44514,7 @@"version": "1.2.2","resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz","integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",+ "dev": true,"dependencies": {"define-data-property": "^1.1.4","es-errors": "^1.3.0",@@ -44484,6 +44531,7 @@"version": "2.0.2","resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz","integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==",+ "dev": true,"license": "MIT","dependencies": {"define-data-property": "^1.1.4",@@ -44499,6 +44547,7 @@"version": "1.0.0","resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz","integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==",+ "dev": true,"license": "MIT","dependencies": {"dunder-proto": "^1.0.1",@@ -45172,6 +45221,7 @@"version": "1.2.10","resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz","integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==",+ "dev": true,"license": "MIT","dependencies": {"call-bind": "^1.0.8",@@ -45193,6 +45243,7 @@"version": "1.0.9","resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz","integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==",+ "dev": true,"license": "MIT","dependencies": {"call-bind": "^1.0.8",@@ -45211,6 +45262,7 @@"version": "1.0.8","resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz","integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==",+ "dev": true,"dependencies": {"call-bind": "^1.0.7","define-properties": "^1.2.1",@@ -46245,6 +46297,7 @@"version": "1.0.3","resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz","integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3",@@ -46259,6 +46312,7 @@"version": "1.0.3","resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz","integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==",+ "dev": true,"license": "MIT","dependencies": {"call-bind": "^1.0.8",@@ -46278,6 +46332,7 @@"version": "1.0.4","resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz","integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==",+ "dev": true,"license": "MIT","dependencies": {"available-typed-arrays": "^1.0.7",@@ -46299,6 +46354,7 @@"version": "1.0.7","resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz","integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==",+ "dev": true,"license": "MIT","dependencies": {"call-bind": "^1.0.7",@@ -46321,28 +46377,6 @@"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==","license": "MIT"},- "node_modules/typedarray.prototype.slice": {- "version": "1.0.5",- "resolved": "https://registry.npmjs.org/typedarray.prototype.slice/-/typedarray.prototype.slice-1.0.5.tgz",- "integrity": "sha512-q7QNVDGTdl702bVFiI5eY4l/HkgCM6at9KhcFbgUAzezHFbOVy4+0O/lCjsABEQwbZPravVfBIiBVGo89yzHFg==",- "peer": true,- "dependencies": {- "call-bind": "^1.0.8",- "define-properties": "^1.2.1",- "es-abstract": "^1.23.9",- "es-errors": "^1.3.0",- "get-proto": "^1.0.1",- "math-intrinsics": "^1.1.0",- "typed-array-buffer": "^1.0.3",- "typed-array-byte-offset": "^1.0.4"- },- "engines": {- "node": ">= 0.4"- },- "funding": {- "url": "https://github.com/sponsors/ljharb"- }- },"node_modules/typescript": {"version": "5.3.3","resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",@@ -46433,6 +46467,7 @@"version": "1.1.0","resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz","integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.3",@@ -47536,6 +47571,7 @@"version": "1.1.1","resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz","integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==",+ "dev": true,"license": "MIT","dependencies": {"is-bigint": "^1.1.0",@@ -47555,6 +47591,7 @@"version": "1.2.1","resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz","integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==",+ "dev": true,"license": "MIT","dependencies": {"call-bound": "^1.0.2",@@ -47582,12 +47619,14 @@"version": "2.0.5","resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz","integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",+ "dev": true,"license": "MIT"},"node_modules/which-collection": {"version": "1.0.2","resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz","integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==",+ "dev": true,"license": "MIT","dependencies": {"is-map": "^2.0.3",@@ -47606,6 +47645,7 @@"version": "1.1.18","resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz","integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==",+ "dev": true,"license": "MIT","dependencies": {"available-typed-arrays": "^1.0.7",@@ -48787,7 +48827,7 @@},"packages/data-schemas": {"name": "@librechat/data-schemas",- "version": "0.0.13",+ "version": "0.0.15","license": "MIT","devDependencies": {"@rollup/plugin-alias": "^5.1.0",@@ -48801,7 +48841,6 @@"@types/express": "^5.0.0","@types/jest": "^29.5.2","@types/node": "^20.3.0",- "@types/traverse": "^0.6.37","jest": "^29.5.0","jest-junit": "^16.0.0","mongodb-memory-server": "^10.1.4",@@ -48815,14 +48854,12 @@},"peerDependencies": {"jsonwebtoken": "^9.0.2",- "keyv": "^5.3.2","klona": "^2.0.6","librechat-data-provider": "*","lodash": "^4.17.21","meilisearch": "^0.38.0","mongoose": "^8.12.1","nanoid": "^3.3.7",- "traverse": "^0.6.11","winston": "^3.17.0","winston-daily-rotate-file": "^5.0.0"}@@ -49014,23 +49051,6 @@"url": "https://github.com/sponsors/isaacs"}},- "packages/data-schemas/node_modules/traverse": {- "version": "0.6.11",- "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.11.tgz",- "integrity": "sha512-vxXDZg8/+p3gblxB6BhhG5yWVn1kGRlaL8O78UDXc3wRnPizB5g83dcvWV1jpDMIPnjZjOFuxlMmE82XJ4407w==",- "peer": true,- "dependencies": {- "gopd": "^1.2.0",- "typedarray.prototype.slice": "^1.0.5",- "which-typed-array": "^1.1.18"- },- "engines": {- "node": ">= 0.4"- },- "funding": {- "url": "https://github.com/sponsors/ljharb"- }- },"packages/data-schemas/node_modules/winston": {"version": "3.17.0","resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz",diff --git a/packages/data-schemas/package.json b/packages/data-schemas/package.jsonindex 651f82e22c..71c5ccc630 100644--- a/packages/data-schemas/package.json+++ b/packages/data-schemas/package.json@@ -1,6 +1,6 @@{"name": "@librechat/data-schemas",- "version": "0.0.13",+ "version": "0.0.15","description": "Mongoose schemas and models for LibreChat","type": "module","main": "dist/index.cjs",@@ -48,7 +48,6 @@"@types/express": "^5.0.0","@types/jest": "^29.5.2","@types/node": "^20.3.0",- "@types/traverse": "^0.6.37","jest": "^29.5.0","jest-junit": "^16.0.0","mongodb-memory-server": "^10.1.4",@@ -62,14 +61,12 @@},"peerDependencies": {"jsonwebtoken": "^9.0.2",- "keyv": "^5.3.2","klona": "^2.0.6","librechat-data-provider": "*","lodash": "^4.17.21","meilisearch": "^0.38.0","mongoose": "^8.12.1","nanoid": "^3.3.7",- "traverse": "^0.6.11","winston": "^3.17.0","winston-daily-rotate-file": "^5.0.0"},diff --git a/packages/data-schemas/src/config/parsers.ts b/packages/data-schemas/src/config/parsers.tsindex 3064844815..c74e03a222 100644--- a/packages/data-schemas/src/config/parsers.ts+++ b/packages/data-schemas/src/config/parsers.ts@@ -1,6 +1,7 @@import { klona } from 'klona';import winston from 'winston';-import traverse from 'traverse';+import traverse from '../utils/object-traverse';+import type { TraverseContext } from '../utils/object-traverse';const SPLAT_SYMBOL = Symbol.for('splat');const MESSAGE_SYMBOL = Symbol.for('message');@@ -123,15 +124,17 @@ const debugTraverse = winston.format.printf(return `${timestamp} ${level}: ${JSON.stringify(message)}`;}- let msg = `${timestamp} ${level}: ${truncateLongStrings(message.trim(), 150)}`;+ const msgParts: string[] = [+ `${timestamp} ${level}: ${truncateLongStrings(message.trim(), 150)}`,+ ];try {if (level !== 'debug') {- return msg;+ return msgParts[0];}if (!metadata) {- return msg;+ return msgParts[0];}// Type-safe access to SPLAT_SYMBOL using bracket notation@@ -140,59 +143,66 @@ const debugTraverse = winston.format.printf(const debugValue = Array.isArray(splatArray) ? splatArray[0] : undefined;if (!debugValue) {- return msg;+ return msgParts[0];}if (debugValue && Array.isArray(debugValue)) {- msg += `\n${JSON.stringify(debugValue.map(condenseArray))}`;- return msg;+ msgParts.push(`\n${JSON.stringify(debugValue.map(condenseArray))}`);+ return msgParts.join('');}if (typeof debugValue !== 'object') {- return (msg += ` ${debugValue}`);+ msgParts.push(` ${debugValue}`);+ return msgParts.join('');}- msg += '\n{';+ msgParts.push('\n{');const copy = klona(metadata);+ try {+ const traversal = traverse(copy);+ traversal.forEach(function (this: TraverseContext, value: unknown) {+ if (typeof this?.key === 'symbol') {+ return;+ }++ let _parentKey = '';+ const parent = this.parent;++ if (typeof parent?.key !== 'symbol' && parent?.key !== undefined) {+ _parentKey = String(parent.key);+ }++ const parentKey = `${parent && parent.notRoot ? _parentKey + '.' : ''}`;+ const tabs = `${parent && parent.notRoot ? ' ' : ' '}`;+ const currentKey = this?.key ?? 'unknown';++ if (this.isLeaf && typeof value === 'string') {+ const truncatedText = truncateLongStrings(value);+ msgParts.push(`\n${tabs}${parentKey}${currentKey}: ${JSON.stringify(truncatedText)},`);+ } else if (this.notLeaf && Array.isArray(value) && value.length > 0) {+ const currentMessage = `\n${tabs}// ${value.length} ${String(currentKey).replace(/s$/, '')}(s)`;+ this.update(currentMessage);+ msgParts.push(currentMessage);+ const stringifiedArray = value.map(condenseArray);+ msgParts.push(`\n${tabs}${parentKey}${currentKey}: [${stringifiedArray}],`);+ } else if (this.isLeaf && typeof value === 'function') {+ msgParts.push(`\n${tabs}${parentKey}${currentKey}: function,`);+ } else if (this.isLeaf) {+ msgParts.push(`\n${tabs}${parentKey}${currentKey}: ${value},`);+ }+ });+ } catch (e: unknown) {+ const errorMessage = e instanceof Error ? e.message : 'Unknown error';+ msgParts.push(`\n[LOGGER TRAVERSAL ERROR] ${errorMessage}`);+ }- traverse(copy).forEach(function (this: traverse.TraverseContext, value: unknown) {- if (typeof this?.key === 'symbol') {- return;- }-- let _parentKey = '';- const parent = this.parent;-- if (typeof parent?.key !== 'symbol' && parent?.key) {- _parentKey = parent.key;- }-- const parentKey = `${parent && parent.notRoot ? _parentKey + '.' : ''}`;- const tabs = `${parent && parent.notRoot ? ' ' : ' '}`;- const currentKey = this?.key ?? 'unknown';-- if (this.isLeaf && typeof value === 'string') {- const truncatedText = truncateLongStrings(value);- msg += `\n${tabs}${parentKey}${currentKey}: ${JSON.stringify(truncatedText)},`;- } else if (this.notLeaf && Array.isArray(value) && value.length > 0) {- const currentMessage = `\n${tabs}// ${value.length} ${currentKey.replace(/s$/, '')}(s)`;- this.update(currentMessage, true);- msg += currentMessage;- const stringifiedArray = value.map(condenseArray);- msg += `\n${tabs}${parentKey}${currentKey}: [${stringifiedArray}],`;- } else if (this.isLeaf && typeof value === 'function') {- msg += `\n${tabs}${parentKey}${currentKey}: function,`;- } else if (this.isLeaf) {- msg += `\n${tabs}${parentKey}${currentKey}: ${value},`;- }- });-- msg += '\n}';- return msg;+ msgParts.push('\n}');+ return msgParts.join('');} catch (e: unknown) {const errorMessage = e instanceof Error ? e.message : 'Unknown error';- return (msg += `\n[LOGGER PARSING ERROR] ${errorMessage}`);+ msgParts.push(`\n[LOGGER PARSING ERROR] ${errorMessage}`);+ return msgParts.join('');}},);diff --git a/packages/data-schemas/src/utils/object-traverse.ts b/packages/data-schemas/src/utils/object-traverse.tsnew file mode 100644index 0000000000..836f59a345--- /dev/null+++ b/packages/data-schemas/src/utils/object-traverse.ts@@ -0,0 +1,178 @@+/**+ * ESM-native object traversal utility+ * Simplified implementation focused on the forEach use case+ */++export interface TraverseContext {+ node: unknown;+ path: (string | number)[];+ parent: TraverseContext | undefined;+ key: string | number | undefined;+ isLeaf: boolean;+ notLeaf: boolean;+ isRoot: boolean;+ notRoot: boolean;+ level: number;+ circular: TraverseContext | null;+ update: (value: unknown, stopHere?: boolean) => void;+ remove: () => void;+}++type ForEachCallback = (this: TraverseContext, value: unknown) => void;++// Type guards for proper typing+type TraversableObject = Record<string | number, unknown> | unknown[];++function isObject(value: unknown): value is TraversableObject {+ if (value === null || typeof value !== 'object') {+ return false;+ }++ // Treat these built-in types as leaf nodes, not objects to traverse+ if (value instanceof Date) return false;+ if (value instanceof RegExp) return false;+ if (value instanceof Error) return false;+ if (value instanceof URL) return false;++ // Check for Buffer (Node.js)+ if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) return false;++ // Check for TypedArrays and ArrayBuffer+ if (ArrayBuffer.isView(value)) return false;+ if (value instanceof ArrayBuffer) return false;+ if (value instanceof SharedArrayBuffer) return false;++ // Check for other built-in types that shouldn't be traversed+ if (value instanceof Promise) return false;+ if (value instanceof WeakMap) return false;+ if (value instanceof WeakSet) return false;+ if (value instanceof Map) return false;+ if (value instanceof Set) return false;++ // Check if it's a primitive wrapper object+ const stringTag = Object.prototype.toString.call(value);+ if (+ stringTag === '[object Boolean]' ||+ stringTag === '[object Number]' ||+ stringTag === '[object String]'+ ) {+ return false;+ }++ return true;+}++// Helper to safely set a property on an object or array+function setProperty(obj: TraversableObject, key: string | number, value: unknown): void {+ if (Array.isArray(obj) && typeof key === 'number') {+ obj[key] = value;+ } else if (!Array.isArray(obj) && typeof key === 'string') {+ obj[key] = value;+ } else if (!Array.isArray(obj) && typeof key === 'number') {+ // Handle numeric keys on objects+ obj[key] = value;+ }+}++// Helper to safely delete a property from an object+function deleteProperty(obj: TraversableObject, key: string | number): void {+ if (Array.isArray(obj) && typeof key === 'number') {+ // For arrays, we should use splice, but this is handled in remove()+ // This function is only called for non-array deletion+ return;+ }++ if (!Array.isArray(obj)) {+ delete obj[key];+ }+}++function forEach(obj: unknown, callback: ForEachCallback): void {+ const visited = new WeakSet<object>();++ function walk(node: unknown, path: (string | number)[] = [], parent?: TraverseContext): void {+ // Check for circular references+ let circular: TraverseContext | null = null;+ if (isObject(node)) {+ if (visited.has(node)) {+ // Find the circular reference in the parent chain+ let p = parent;+ while (p) {+ if (p.node === node) {+ circular = p;+ break;+ }+ p = p.parent;+ }+ return; // Skip circular references+ }+ visited.add(node);+ }++ const key = path.length > 0 ? path[path.length - 1] : undefined;+ const isRoot = path.length === 0;+ const level = path.length;++ // Determine if this is a leaf node+ const isLeaf =+ !isObject(node) ||+ (Array.isArray(node) && node.length === 0) ||+ Object.keys(node).length === 0;++ // Create context+ const context: TraverseContext = {+ node,+ path: [...path],+ parent,+ key,+ isLeaf,+ notLeaf: !isLeaf,+ isRoot,+ notRoot: !isRoot,+ level,+ circular,+ update(value: unknown) {+ if (!isRoot && parent && key !== undefined && isObject(parent.node)) {+ setProperty(parent.node, key, value);+ }+ this.node = value;+ },+ remove() {+ if (!isRoot && parent && key !== undefined && isObject(parent.node)) {+ if (Array.isArray(parent.node) && typeof key === 'number') {+ parent.node.splice(key, 1);+ } else {+ deleteProperty(parent.node, key);+ }+ }+ },+ };++ // Call the callback with the context+ callback.call(context, node);++ // Traverse children if not circular and is an object+ if (!circular && isObject(node) && !isLeaf) {+ if (Array.isArray(node)) {+ for (let i = 0; i < node.length; i++) {+ walk(node[i], [...path, i], context);+ }+ } else {+ for (const [childKey, childValue] of Object.entries(node)) {+ walk(childValue, [...path, childKey], context);+ }+ }+ }+ }++ walk(obj);+}++// Main traverse function that returns an object with forEach method+export default function traverse(obj: unknown) {+ return {+ forEach(callback: ForEachCallback): void {+ forEach(obj, callback);+ },+ };+}