From 36531b3cba77148c14ac439d1df2b1b7156aba00 Mon Sep 17 00:00:00 2001 From: mmiscool Date: Sat, 14 Dec 2024 02:48:23 -0500 Subject: [PATCH] build: cleanup of dead code --- package-lock.json | 1016 +---------------------------------- package.json | 4 - public/domElementFactory.js | 1 - public/fileDialog.js | 251 +++++---- public/test/test.html | 9 + public/test/test.js | 0 src/aiCoderApiFunctions.js | 2 +- src/backupSystem.js | 67 +-- src/fileIO.js | 7 +- src/intelligentMerge.js | 3 - src/llmCall.js | 4 +- src/main.js | 2 +- src/terminalHelpers.js | 34 +- 13 files changed, 171 insertions(+), 1229 deletions(-) create mode 100644 public/test/test.html create mode 100644 public/test/test.js diff --git a/package-lock.json b/package-lock.json index 394025b..6b5d4a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,16 +13,12 @@ "@mmiscool/scrape_to_markdown": "^1.0.6", "axios": "^1.7.9", "cheerio": "^1.0.0", - "cli-highlight": "^2.1.11", "cli-progress": "^3.12.0", "escodegen": "^2.1.0", "esm": "^3.2.25", "esprima-next": "^6.0.3", "estraverse": "^5.3.0", - "glob": "^11.0.0", "groq-sdk": "^0.7.0", - "inquirer": "^12.0.1", - "inquirer-file-selector": "^0.5.0", "mime": "^4.0.4", "ollama": "^0.5.9", "openai": "^4.68.4", @@ -89,339 +85,6 @@ "node": ">=6.9.0" } }, - "node_modules/@inquirer/checkbox": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.0.1.tgz", - "integrity": "sha512-ehJjmNPdguajc1hStvjN7DJNVjwG5LC1mgGMGFjCmdkn2fxB2GtULftMnlaqNmvMdPpqdaSoOFpl86VkLtG4pQ==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/figures": "^1.0.7", - "@inquirer/type": "^3.0.0", - "ansi-escapes": "^4.3.2", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/confirm": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.0.1.tgz", - "integrity": "sha512-6ycMm7k7NUApiMGfVc32yIPp28iPKxhGRMqoNDiUjq2RyTAkbs5Fx0TdzBqhabcKvniDdAAvHCmsRjnNfTsogw==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/type": "^3.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/core": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.1.tgz", - "integrity": "sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==", - "license": "MIT", - "dependencies": { - "@inquirer/figures": "^1.0.8", - "@inquirer/type": "^3.0.1", - "ansi-escapes": "^4.3.2", - "cli-width": "^4.1.0", - "mute-stream": "^2.0.0", - "signal-exit": "^4.1.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^6.2.0", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/editor": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.0.1.tgz", - "integrity": "sha512-qAHHJ6hs343eNtCKgV2wV5CImFxYG8J1pl/YCeI5w9VoW7QpulRUU26+4NsMhjR6zDRjKBsH/rRjCIcaAOHsrg==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/type": "^3.0.0", - "external-editor": "^3.1.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/expand": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.1.tgz", - "integrity": "sha512-9anjpdc802YInXekwePsa5LWySzVMHbhVS6v6n5IJxrl8w09mODOeP69wZ1d0WrOvot2buQSmYp4lW/pq8y+zQ==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/type": "^3.0.0", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/figures": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.8.tgz", - "integrity": "sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==", - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/input": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.0.1.tgz", - "integrity": "sha512-m+SliZ2m43cDRIpAdQxfv5QOeAQCuhS8TGLvtzEP1An4IH1kBES4RLMRgE/fC+z29aN8qYG8Tq/eXQQKTYwqAg==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/type": "^3.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/number": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.1.tgz", - "integrity": "sha512-gF3erqfm0snpwBjbyKXUUe17QJ7ebm49btXApajrM0rgCCoYX0o9W5NCuYNae87iPxaIJVjtuoQ42DX32IdbMA==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/type": "^3.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/password": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.1.tgz", - "integrity": "sha512-D7zUuX4l4ZpL3D7/SWu9ibijP09jigwHi/gfUHLx5GMS5oXzuMfPV2xPMG1tskco4enTx70HA0VtMXecerpvbg==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/type": "^3.0.0", - "ansi-escapes": "^4.3.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/prompts": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.0.1.tgz", - "integrity": "sha512-cu2CpGC2hz7WTt2VBvdkzahDvYice6vYA/8Dm7Fy3tRNzKuQTF2EY3CV4H2GamveWE6tA2XzyXtbWX8+t4WMQg==", - "license": "MIT", - "dependencies": { - "@inquirer/checkbox": "^4.0.1", - "@inquirer/confirm": "^5.0.1", - "@inquirer/editor": "^4.0.1", - "@inquirer/expand": "^4.0.1", - "@inquirer/input": "^4.0.1", - "@inquirer/number": "^3.0.1", - "@inquirer/password": "^4.0.1", - "@inquirer/rawlist": "^4.0.1", - "@inquirer/search": "^3.0.1", - "@inquirer/select": "^4.0.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/rawlist": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.0.1.tgz", - "integrity": "sha512-0LuMOgaWs7W8JNcbiKkoFwyWFDEeCmLqDCygF0hidQUVa6J5grFVRZxrpompiWDFM49Km2rf7WoZwRo1uf1yWQ==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/type": "^3.0.0", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/search": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.0.1.tgz", - "integrity": "sha512-ehMqjiO0pAf+KtdONKeCLVy4i3fy3feyRRhDrvzWhiwB8JccgKn7eHFr39l+Nx/FaZAhr0YxIJvkK5NuNvG+Ww==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/figures": "^1.0.7", - "@inquirer/type": "^3.0.0", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/select": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.0.1.tgz", - "integrity": "sha512-tVRatFRGU49bxFCKi/3P+C0E13KZduNFbWuHWRx0L2+jbiyKRpXgHp9qiRHWRk/KarhYBXzH/di6w3VQ5aJd5w==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/figures": "^1.0.7", - "@inquirer/type": "^3.0.0", - "ansi-escapes": "^4.3.2", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/type": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz", - "integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "license": "MIT" - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/@lezer/common": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", @@ -2547,15 +2210,6 @@ "node": ">= 10" } }, - "node_modules/@types/mute-stream": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", - "integrity": "sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/node": { "version": "22.10.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", @@ -2575,12 +2229,6 @@ "form-data": "^4.0.0" } }, - "node_modules/@types/wrap-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", - "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==", - "license": "MIT" - }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -2667,21 +2315,6 @@ "node": ">= 8.0.0" } }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "license": "MIT", - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -2706,12 +2339,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "license": "MIT" - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -2735,12 +2362,6 @@ "proxy-from-env": "^1.1.0" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "license": "MIT" - }, "node_modules/base-x": { "version": "3.0.10", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", @@ -2756,15 +2377,6 @@ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "license": "ISC" }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/braces": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", @@ -2860,12 +2472,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "license": "MIT" - }, "node_modules/cheerio": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", @@ -2942,27 +2548,6 @@ "node": ">=6.0" } }, - "node_modules/cli-highlight": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", - "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", - "license": "ISC", - "dependencies": { - "chalk": "^4.0.0", - "highlight.js": "^10.7.1", - "mz": "^2.4.0", - "parse5": "^5.1.1", - "parse5-htmlparser2-tree-adapter": "^6.0.0", - "yargs": "^16.0.0" - }, - "bin": { - "highlight": "bin/highlight" - }, - "engines": { - "node": ">=8.0.0", - "npm": ">=5.0.0" - } - }, "node_modules/cli-progress": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz", @@ -2975,43 +2560,6 @@ "node": ">=4" } }, - "node_modules/cli-width": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", - "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", - "license": "ISC", - "engines": { - "node": ">= 12" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/clone": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", @@ -3086,20 +2634,6 @@ } } }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/css-select": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", @@ -3351,12 +2885,6 @@ "url": "https://dotenvx.com" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "license": "MIT" - }, "node_modules/electron-to-chromium": { "version": "1.5.73", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.73.tgz", @@ -3516,27 +3044,13 @@ "node": ">=6" } }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "license": "MIT", "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" + "to-regex-range": "^5.0.1" }, "engines": { "node": ">=8" @@ -3562,22 +3076,6 @@ } } }, - "node_modules/foreground-child": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/form-data": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", @@ -3611,15 +3109,6 @@ "node": ">= 12.20" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, "node_modules/get-port": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/get-port/-/get-port-4.2.0.tgz", @@ -3629,29 +3118,6 @@ "node": ">=6" } }, - "node_modules/glob": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", - "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/globals": { "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", @@ -3718,15 +3184,6 @@ "node": ">=8" } }, - "node_modules/highlight.js": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", - "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", - "license": "BSD-3-Clause", - "engines": { - "node": "*" - } - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -3893,97 +3350,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/inquirer": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-12.0.1.tgz", - "integrity": "sha512-o11Jc2Go6wDZA17SWofiJ6L8k7mB8lsdKB/QY0bI+8e+ATiAvQzmROjqoTd1iAY8RI6N/EDcQcxbQa4JYviDWg==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.0.1", - "@inquirer/prompts": "^7.0.1", - "@inquirer/type": "^3.0.0", - "ansi-escapes": "^4.3.2", - "mute-stream": "^2.0.0", - "run-async": "^3.0.0", - "rxjs": "^7.8.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/inquirer-file-selector": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/inquirer-file-selector/-/inquirer-file-selector-0.5.0.tgz", - "integrity": "sha512-G6htrFYU11aSaSGyL32E2o0hqjvQEEoApGo4P9QmySQeLO8Y9O1UbBmyJGyfueSZMqTrMPCEyc5YDmN7viDhZw==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/figures": "^1.0.6", - "chalk": "^5.3.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/inquirer-file-selector/node_modules/@inquirer/core": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-9.2.1.tgz", - "integrity": "sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg==", - "license": "MIT", - "dependencies": { - "@inquirer/figures": "^1.0.6", - "@inquirer/type": "^2.0.0", - "@types/mute-stream": "^0.0.4", - "@types/node": "^22.5.5", - "@types/wrap-ansi": "^3.0.0", - "ansi-escapes": "^4.3.2", - "cli-width": "^4.1.0", - "mute-stream": "^1.0.0", - "signal-exit": "^4.1.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^6.2.0", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/inquirer-file-selector/node_modules/@inquirer/type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-2.0.0.tgz", - "integrity": "sha512-XvJRx+2KR3YXyYtPUUy+qd9i7p+GO9Ko6VIIpWlBrpWwXDv8WLFeHTxz35CfQFUiBMLXlGHhGzys7lqit9gWag==", - "license": "MIT", - "dependencies": { - "mute-stream": "^1.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/inquirer-file-selector/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/inquirer-file-selector/node_modules/mute-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", - "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -4041,27 +3407,6 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "license": "MIT" }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "license": "ISC" - }, - "node_modules/jackspeak": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz", - "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==", - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4490,15 +3835,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "license": "MIT" }, - "node_modules/lru-cache": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.1.tgz", - "integrity": "sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==", - "license": "ISC", - "engines": { - "node": "20 || >=22" - } - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -4548,30 +3884,6 @@ "node": ">= 0.6" } }, - "node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4634,26 +3946,6 @@ "node-gyp-build-optional-packages-test": "build-test.js" } }, - "node_modules/mute-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz", - "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==", - "license": "ISC", - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, "node_modules/node-addon-api": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", @@ -4752,15 +4044,6 @@ "integrity": "sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ==", "license": "MIT" }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ollama": { "version": "0.5.9", "resolved": "https://registry.npmjs.org/ollama/-/ollama-0.5.9.tgz", @@ -4817,21 +4100,6 @@ "integrity": "sha512-oGFr3T+pYdTGJ+YFEILMpS3es+GiIbs9h/XQrclBXUtd44ey7XwfsMzM31f64I1SQOawDoDr/D823kNCADI8TA==", "license": "MIT" }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "license": "BlueOak-1.0.0" - }, "node_modules/parcel": { "version": "2.13.2", "resolved": "https://registry.npmjs.org/parcel/-/parcel-2.13.2.tgz", @@ -4895,27 +4163,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", - "license": "MIT" - }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", - "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", - "license": "MIT", - "dependencies": { - "parse5": "^6.0.1" - } - }, - "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "license": "MIT" - }, "node_modules/parse5-parser-stream": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", @@ -4940,31 +4187,6 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -5175,15 +4397,6 @@ "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", "license": "MIT" }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -5205,24 +4418,6 @@ "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "license": "MIT" }, - "node_modules/run-async": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", - "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.1.0" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -5273,39 +4468,6 @@ "node": ">=10" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5344,21 +4506,6 @@ "node": ">=8" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -5371,19 +4518,6 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -5414,45 +4548,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "license": "MIT", - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/timsort": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", "integrity": "sha512-qsdtZH+vMoCARQtyod4imc2nIJwg9Cc7lPRrw9CzF8ZKR0khdr8+2nX80PBhET3tcyTtJDxAffGh2rXH4tyU8A==", "license": "MIT" }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "license": "MIT", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -5507,18 +4608,6 @@ "integrity": "sha512-vwz9tfvF7XN/jE0dGoBei3FXWuvll78ohzCZQuOb+ZjWrs3a0XhQVomJEb2Qh4VHTPNRO4GPZh0V7VRbiWwkRg==", "license": "MIT" }, - "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/undici": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz", @@ -5684,53 +4773,6 @@ "webidl-conversions": "^3.0.0" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/ws": { "version": "8.18.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", @@ -5766,54 +4808,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "license": "MIT" - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "license": "MIT", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yoctocolors-cjs": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", - "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } } } diff --git a/package.json b/package.json index 1f48e5c..979f27b 100644 --- a/package.json +++ b/package.json @@ -20,16 +20,12 @@ "@mmiscool/scrape_to_markdown": "^1.0.6", "axios": "^1.7.9", "cheerio": "^1.0.0", - "cli-highlight": "^2.1.11", "cli-progress": "^3.12.0", "escodegen": "^2.1.0", "esm": "^3.2.25", "esprima-next": "^6.0.3", "estraverse": "^5.3.0", - "glob": "^11.0.0", "groq-sdk": "^0.7.0", - "inquirer": "^12.0.1", - "inquirer-file-selector": "^0.5.0", "mime": "^4.0.4", "ollama": "^0.5.9", "openai": "^4.68.4", diff --git a/public/domElementFactory.js b/public/domElementFactory.js index aa1c0f2..f8118b2 100644 --- a/public/domElementFactory.js +++ b/public/domElementFactory.js @@ -1,4 +1,3 @@ -// export function makeElement(tag, attributes = {}) { // Create the DOM element const element = document.createElement(tag); diff --git a/public/fileDialog.js b/public/fileDialog.js index ad9c64d..c7c44ea 100644 --- a/public/fileDialog.js +++ b/public/fileDialog.js @@ -1,72 +1,101 @@ // File: fileDialog.js -// File: fileDialog.js -import { doAjax } from "./doAjax.js"; +import { makeElement } from './domElementFactory.js'; +import { doAjax } from './doAjax.js'; export async function fileDialog(fileListArray) { return new Promise((resolve) => { - // Create modal elements - const modal = document.createElement('div'); - modal.id = 'file-dialog'; - modal.style.position = 'fixed'; - modal.style.top = '0'; - modal.style.left = '0'; - modal.style.width = '100vw'; - modal.style.height = '100vh'; - modal.style.backgroundColor = 'rgba(0, 0, 0, 0.8)'; - modal.style.display = 'flex'; - modal.style.justifyContent = 'center'; - modal.style.alignItems = 'center'; - modal.style.zIndex = '10000'; - modal.style.color = '#f0f0f0'; + // Create modal elements using makeElement + const modal = makeElement('div', { + id: 'file-dialog', + style: { + position: 'fixed', + top: '0', + left: '0', + width: '100vw', + height: '100vh', + backgroundColor: 'rgba(0, 0, 0, 0.8)', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + zIndex: '10000', + color: '#f0f0f0', + }, + }); - const dialog = document.createElement('div'); - dialog.id = 'file-dialog-content'; - dialog.style.backgroundColor = '#333'; - dialog.style.padding = '20px'; - dialog.style.borderRadius = '8px'; - dialog.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.4)'; - dialog.style.width = '400px'; - dialog.style.maxHeight = '80vh'; - dialog.style.overflowY = 'auto'; + const dialog = makeElement('div', { + id: 'file-dialog-content', + style: { + backgroundColor: '#333', + padding: '20px', + borderRadius: '8px', + boxShadow: '0 4px 8px rgba(0, 0, 0, 0.4)', + width: '400px', + maxHeight: '80vh', + overflowY: 'auto', + }, + }); - const title = document.createElement('h2'); - title.innerText = 'Select a File'; - title.style.margin = '0 0 20px'; - title.style.color = '#ffffff'; - dialog.appendChild(title); + const title = makeElement('h2', { + innerText: 'Select a File', + style: { + margin: '0 0 20px', + color: '#ffffff', + }, + }); - const fileTreeContainer = document.createElement('ul'); - fileTreeContainer.style.listStyleType = 'none'; - fileTreeContainer.style.padding = '0'; - fileTreeContainer.style.margin = '0'; - dialog.appendChild(fileTreeContainer); + const fileTreeContainer = makeElement('ul', { + style: { + listStyleType: 'none', + padding: '0', + margin: '0', + }, + }); - const buttonsContainer = document.createElement('div'); - buttonsContainer.style.display = 'flex'; - buttonsContainer.style.justifyContent = 'space-between'; - buttonsContainer.style.marginTop = '20px'; + const buttonsContainer = makeElement('div', { + style: { + display: 'flex', + justifyContent: 'space-between', + marginTop: '20px', + }, + }); - const cancelButton = document.createElement('button'); - cancelButton.innerText = 'Cancel'; - cancelButton.style.padding = '10px 20px'; - cancelButton.style.cursor = 'pointer'; - cancelButton.style.backgroundColor = '#444'; - cancelButton.style.border = 'none'; - cancelButton.style.borderRadius = '4px'; - cancelButton.style.color = '#f0f0f0'; + const cancelButton = makeElement('button', { + innerText: 'Cancel', + style: { + padding: '10px 20px', + cursor: 'pointer', + backgroundColor: '#444', + border: 'none', + borderRadius: '4px', + color: '#f0f0f0', + }, + onclick: () => { + resolve(null); + document.body.removeChild(modal); + }, + }); - const selectButton = document.createElement('button'); - selectButton.innerText = 'Select'; - selectButton.disabled = true; - selectButton.style.padding = '10px 20px'; - selectButton.style.cursor = 'pointer'; - selectButton.style.backgroundColor = '#444'; - selectButton.style.border = 'none'; - selectButton.style.borderRadius = '4px'; - selectButton.style.color = '#f0f0f0'; + const selectButton = makeElement('button', { + innerText: 'Select', + disabled: true, + style: { + padding: '10px 20px', + cursor: 'pointer', + backgroundColor: '#444', + border: 'none', + borderRadius: '4px', + color: '#f0f0f0', + }, + onclick: () => { + resolve(selectedFile.substring(1)); + document.body.removeChild(modal); + }, + }); buttonsContainer.appendChild(cancelButton); buttonsContainer.appendChild(selectButton); + dialog.appendChild(title); + dialog.appendChild(fileTreeContainer); dialog.appendChild(buttonsContainer); modal.appendChild(dialog); document.body.appendChild(modal); @@ -88,88 +117,82 @@ export async function fileDialog(fileListArray) { } function renderTree(tree, container, path = '', isRoot = false) { - Object.keys(tree).forEach((key) => { - const item = document.createElement('li'); - item.style.marginLeft = '10px'; - item.style.color = tree[key] === null ? '#66ccff' : '#ffffff'; // Blue for files, white for folders - - const label = document.createElement('span'); - label.innerText = key; - label.style.cursor = tree[key] === null ? 'pointer' : 'default'; - - // Add Unicode icons - if (tree[key] === null) { - label.innerText = `📄 ${key}`; // File icon - } else { - label.innerText = `📁 ${key}/`; // Folder icon - } - + // Sort keys: folders first, then files, both alphabetically + const sortedKeys = Object.keys(tree).sort((a, b) => { + const isFolderA = tree[a] !== null; + const isFolderB = tree[b] !== null; + + if (isFolderA && !isFolderB) return -1; // Folders before files + if (!isFolderA && isFolderB) return 1; // Files after folders + return a.localeCompare(b); // Alphabetical order + }); + + sortedKeys.forEach((key) => { + const item = makeElement('li', { + style: { + marginLeft: '10px', + color: tree[key] === null ? '#66ccff' : '#ffffff', + }, + }); + + const label = makeElement('span', { + innerText: tree[key] === null ? `📄 ${key}` : `📁 ${key}/`, + style: { + cursor: tree[key] === null ? 'pointer' : 'default', + }, + onclick: () => { + if (tree[key] === null) { + // Deselect all other items + container.querySelectorAll('.selected').forEach((el) => el.classList.remove('selected')); + + // Select the clicked file + label.classList.add('selected'); + selectedFile = path + '/' + key; + + // Resolve immediately on file click + resolve(selectedFile.substring(1)); + document.body.removeChild(modal); + } + }, + }); + item.appendChild(label); container.appendChild(item); - + if (tree[key] !== null) { - const subList = document.createElement('ul'); - subList.style.listStyleType = 'none'; - subList.style.paddingLeft = '20px'; - subList.style.display = isRoot ? 'block' : 'none'; // Expand root by default, collapse others - + const subList = makeElement('ul', { + style: { + listStyleType: 'none', + paddingLeft: '20px', + display: isRoot ? 'block' : 'none', + }, + }); + renderTree(tree[key], subList, path + '/' + key); item.appendChild(subList); - + label.style.cursor = 'pointer'; label.addEventListener('click', () => { subList.style.display = subList.style.display === 'none' ? 'block' : 'none'; }); } - - label.addEventListener('click', () => { - if (tree[key] === null) { - const allItems = container.querySelectorAll('.selected'); - allItems.forEach((i) => i.classList.remove('selected')); - label.classList.add('selected'); - selectedFile = path + '/' + key; - selectButton.disabled = false; - - resolve(selectedFile.substring(1)); - document.body.removeChild(modal); - } - }); - - - // if (tree[key] === null) { - // label.addEventListener('click', () => { - // resolve(selectedFile.substring(1)); - // document.body.removeChild(modal); - // }); - // } }); } + + // Build and render the tree const tree = buildTree(fileListArray); let selectedFile = null; renderTree(tree, fileTreeContainer, '', true); // Root node expanded - - // Handle dialog actions - cancelButton.addEventListener('click', () => { - resolve(null); - document.body.removeChild(modal); - }); - - selectButton.addEventListener('click', () => { - resolve(selectedFile.substring(1)); - document.body.removeChild(modal); - }); }); } - - export async function choseFile() { const response = await doAjax('/getFilesList', {}); const fileList = response.files || []; const selectedFile = await fileDialog(fileList); return selectedFile; -} \ No newline at end of file +} diff --git a/public/test/test.html b/public/test/test.html new file mode 100644 index 0000000..6af7f9e --- /dev/null +++ b/public/test/test.html @@ -0,0 +1,9 @@ + + + + Sample transpiling ES6 to ES5 + + + + + \ No newline at end of file diff --git a/public/test/test.js b/public/test/test.js new file mode 100644 index 0000000..e69de29 diff --git a/src/aiCoderApiFunctions.js b/src/aiCoderApiFunctions.js index bd995a6..f78b64d 100644 --- a/src/aiCoderApiFunctions.js +++ b/src/aiCoderApiFunctions.js @@ -1,6 +1,6 @@ import { applySnippets } from "./intelligentMerge.js" import { getListOfFunctions, getMethodsWithArguments } from "./classListing.js"; -import { appendFile, getAllFiles, moveFile, readFile, readOrLoadFromDefault, readSetting, writeFile, writeSetting } from "./fileIO.js"; +import { getAllFiles, moveFile, readFile, readSetting, writeFile, writeSetting } from "./fileIO.js"; import { intelligentlyMergeSnippets } from "./intelligentMerge.js"; import { llmSettings, llmSettingsUpdate } from "./llmCall.js"; import { launchEditor } from "./terminalHelpers.js"; diff --git a/src/backupSystem.js b/src/backupSystem.js index 0c150db..59082a8 100644 --- a/src/backupSystem.js +++ b/src/backupSystem.js @@ -1,14 +1,7 @@ import fs from 'fs'; import path from 'path'; import crypto from 'crypto'; -import { convertToRelativePath, createFolderIfNotExists } from './fileIO.js'; -import inquirer from 'inquirer'; -import { Separator } from '@inquirer/prompts'; - -//import { ctx.targetFile } from './fileSelector.js'; -import { ctx } from './main.js'; -import { clearTerminal, printAndPause, selectListHeight } from './terminalHelpers.js'; - +import { createFolderIfNotExists } from './fileIO.js'; // make a folder including any parent folders if they don't exist export async function createBackup(filePath) { @@ -36,54 +29,10 @@ export async function createBackup(filePath) { export async function rollbackFile(pathToBackupFile) { - await fs.copyFileSync(pathToBackupFile, ctx.targetFile); + await fs.copyFileSync(pathToBackupFile, pathToBackupFile.replace('_backup_', '')); } -export async function restoreFileFromBackup() { - // List all the versions of the ctx.targetFile file in the ./.aiCoder/backups folder - // Ask the user to select a version to restore - // Restore the selected version - const backupFolder = '.aiCoder/backups'; - - let filePath = await convertToRelativePath(ctx.targetFile); - - console.log('Restoring file from backup:', filePath); - - - let allBackupFiles = await listFilesMatchingName(`${backupFolder}/${filePath}_backup_`); - await deleteDuplicates(allBackupFiles); - allBackupFiles = await listFilesMatchingName(`${backupFolder}/${filePath}_backup_`); - - - if (allBackupFiles.length === 0) return console.log('No backups found for this file'); - - await clearTerminal(); - - // Ask the user to select a backup file to restore - const { backupFile } = await inquirer.prompt([ - { - type: 'list', - name: 'backupFile', - message: 'Select a backup version to restore:', - choices: ['Cancel', new Separator(), ...allBackupFiles,], - loop: false, - pageSize: await selectListHeight(), - } - ]); - // clear the terminal - await clearTerminal(); - if (backupFile === 'Cancel') return console.log('File restore cancelled'); - - console.log('Restoring file from backup:', backupFile); - // backup the current file in the ctx.targetFile variable. This needs to be converted to a relative path - await createBackup(convertToRelativePath(ctx.targetFile)); - await rollbackFile(backupFile); - - await printAndPause('File restored successfully'); - -} - export async function listFilesMatchingName(baseFileName) { const results = []; @@ -109,18 +58,6 @@ export async function listFilesMatchingName(baseFileName) { - - - - - - - - - - - - // Helper function to calculate file hash export function calculateFileHash(filePath) { return new Promise((resolve, reject) => { diff --git a/src/fileIO.js b/src/fileIO.js index d3e26c9..b94b8d4 100644 --- a/src/fileIO.js +++ b/src/fileIO.js @@ -25,8 +25,7 @@ export async function readFile(filePath) { export async function writeFile(filePath, content, makeBackup = false) { if (typeof content !== 'string') { - await printAndPause('Content is not a string:'); - await printAndPause(content); + await printDebugMessage('Content is not a string:',content); } // create the folders in the file path if they don't exist let folderPath = path.dirname(filePath); @@ -39,7 +38,7 @@ export async function writeFile(filePath, content, makeBackup = false) { } export async function appendFile(filePath, content, makeBackup = false) { - printDebugMessage("Appending to file:", filePath); + await printDebugMessage("Appending to file:", filePath); filePath = await convertToRelativePath(filePath); if (makeBackup) await createBackup(filePath); await fs.appendFileSync(filePath, content, 'utf8'); @@ -115,8 +114,8 @@ export async function moveFile(oldPath, newPath) { try { let folderPath = path.dirname(newPath); await createFolderIfNotExists(folderPath); - printDebugMessage("Moving file:", oldPath, newPath); await fs.renameSync(oldPath, newPath); + await printDebugMessage("Moving file:", oldPath, newPath); await printAndPause(`File moved: ${oldPath} to ${newPath}`); } catch (error) { //console.log(`Error moving file: ${oldPath} to ${newPath}`); diff --git a/src/intelligentMerge.js b/src/intelligentMerge.js index 5efaf83..4a0d49f 100644 --- a/src/intelligentMerge.js +++ b/src/intelligentMerge.js @@ -1,9 +1,6 @@ -import fs from 'fs'; - import * as escodegen from 'escodegen'; import esprima from 'esprima-next'; import estraverse from 'estraverse'; -import { ctx } from './main.js'; import { appendFile, readFile, writeFile, } from './fileIO.js'; import { createBackup } from './backupSystem.js'; diff --git a/src/llmCall.js b/src/llmCall.js index 68d9520..4bde5b7 100644 --- a/src/llmCall.js +++ b/src/llmCall.js @@ -11,7 +11,7 @@ import { import Anthropic from '@anthropic-ai/sdk'; import cliProgress from 'cli-progress'; import { spawn } from 'child_process'; -import { read } from "fs"; + let throttleTime = 20; @@ -75,7 +75,7 @@ export async function callLLM(messages) { response = await getClaudeResponse(messages); } else { - await printAndPause('This feature is not yet implemented.', 1.5); + await printAndPause('Error: No LLM selected.', 1.5); response = ''; } diff --git a/src/main.js b/src/main.js index 6f21b70..df4953a 100755 --- a/src/main.js +++ b/src/main.js @@ -8,7 +8,7 @@ import { setupServer } from './apiServer.js'; -export const debugMode = false; + // graceful shutdown diff --git a/src/terminalHelpers.js b/src/terminalHelpers.js index a2f85e9..37fd589 100644 --- a/src/terminalHelpers.js +++ b/src/terminalHelpers.js @@ -1,11 +1,19 @@ import { exec } from "child_process"; import path from 'path'; -import { ctx, debugMode } from './main.js'; +import { ctx } from './main.js'; import { wss } from './apiServer.js'; import { readSetting, writeSetting } from "./fileIO.js"; -import { read, write } from "fs"; +export async function printDebugMessage(...message) { + if (await readArg('-debug')) { + const stack = new Error().stack; + const callerLine = stack.split("\n")[2]; + const functionName = callerLine.match(/at (\S+)/)[1]; + console.log(`Called inside function: ${functionName}`); + console.log(...message); + } +} function getCallerInfo(level = 3) { @@ -63,7 +71,7 @@ export async function clearTerminal() { export async function printAndPause(message, secondsToPause = 0) { - await getCallerInfo(); + if (await readArg('-debug')) await getCallerInfo(); wss.clients.forEach(client => { client.send(message); }); @@ -85,10 +93,6 @@ export async function printToTerminal(message) { }); } -export async function selectListHeight() { - return process.stdout.rows - 2; -} - export async function launchEditor(filePath, lineNumber = null) { @@ -185,22 +189,6 @@ export function launchNano(filePath, lineNumber = null) { - - - -export async function printDebugMessage(message) { - if (debugMode) { - const stack = new Error().stack; - const callerLine = stack.split("\n")[2]; - const functionName = callerLine.match(/at (\S+)/)[1]; - console.log(`Called inside function: ${functionName}`); - console.log(message); - } -} - - - - export function readArg(flag) { const index = process.argv.indexOf(flag); if (index !== -1 && index + 1 < process.argv.length) {