diff --git a/.env.development b/.env.development index 6de142a30..c333da04b 100644 --- a/.env.development +++ b/.env.development @@ -3,3 +3,6 @@ VITE_BASE_URL=/api VITE_PROXY_URL=https://dev.eigent.ai VITE_USE_LOCAL_PROXY=false + +# VITE_PROXY_URL=http://localhost:3001 +# VITE_USE_LOCAL_PROXY=true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 48616c358..8c84c5fd0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -12,7 +12,7 @@ body: id: version attributes: label: What version of eigent are you using? - placeholder: E.g., 0.0.48 + placeholder: E.g., 0.0.49 validations: required: true diff --git a/README.md b/README.md index f90046486..f96ffbab7 100644 --- a/README.md +++ b/README.md @@ -354,7 +354,7 @@ For more information please contact info@eigent.ai [camel-github]: https://github.com/camel-ai/camel [eigent-github]: https://github.com/eigent-ai/eigent -[contribution-link]: https:/github.com/eigent-ai/eigent/blob/master/CONTRIBUTING.md +[contribution-link]: https://github.com/eigent-ai/eigent/blob/main/CONTRIBUTING.md [social-x-link]: https://x.com/Eigent_AI [social-x-shield]: https://img.shields.io/badge/-%40Eigent_AI-white?labelColor=gray&logo=x&logoColor=white&style=plastic diff --git a/backend/app/utils/toolkit/hybrid_browser_python_toolkit.py b/backend/app/utils/toolkit/hybrid_browser_python_toolkit.py index e679cac65..911a6dd87 100644 --- a/backend/app/utils/toolkit/hybrid_browser_python_toolkit.py +++ b/backend/app/utils/toolkit/hybrid_browser_python_toolkit.py @@ -83,7 +83,7 @@ class BrowserSession(BaseHybridBrowserSession): await self.get_new_tab() logger.debug(json.dumps([item.url for item in self._context.pages])) if not self._page: - raise ProgramException("Electron does't has page") + raise ProgramException("Maximum Window Limit Reached.") # Apply stealth modifications if enabled if self._stealth and self._stealth_script: diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 0f6b9c049..517a2e9b7 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -5,7 +5,7 @@ description = "Add your description here" readme = "README.md" requires-python = "==3.10.16" dependencies = [ - "camel-ai[eigent]>=0.2.75a2", + "camel-ai[eigent]>=0.2.75a3", "fastapi>=0.115.12", "fastapi-babel>=1.0.0", "uvicorn[standard]>=0.34.2", diff --git a/backend/uv.lock b/backend/uv.lock index 208e3cc0b..2f838f8cd 100644 --- a/backend/uv.lock +++ b/backend/uv.lock @@ -252,7 +252,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "aiofiles", specifier = ">=24.1.0" }, - { name = "camel-ai", extras = ["eigent"], specifier = ">=0.2.75a2" }, + { name = "camel-ai", extras = ["eigent"], specifier = ">=0.2.75a3" }, { name = "fastapi", specifier = ">=0.115.12" }, { name = "fastapi-babel", specifier = ">=1.0.0" }, { name = "httpx", extras = ["socks"], specifier = ">=0.28.1" }, @@ -281,9 +281,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/50/cd/30110dc0ffcf3b131156077b90e9f60ed75711223f306da4db08eff8403b/beautifulsoup4-4.13.4-py3-none-any.whl", hash = "sha256:9bbbb14bfde9d79f38b8cd5f8c7c85f4b8f2523190ebed90e950a8dea4cb1c4b", size = 187285, upload-time = "2025-04-15T17:05:12.221Z" }, ] +[[package]] +name = "cachetools" +version = "5.5.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6c/81/3747dad6b14fa2cf53fcf10548cf5aea6913e96fab41a3c198676f8948a5/cachetools-5.5.2.tar.gz", hash = "sha256:1a661caa9175d26759571b2e19580f9d6393969e5dfca11fdb1f947a23e640d4", size = 28380, upload-time = "2025-02-20T21:01:19.524Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/72/76/20fa66124dbe6be5cafeb312ece67de6b61dd91a0247d1ea13db4ebb33c2/cachetools-5.5.2-py3-none-any.whl", hash = "sha256:d26a22bcc62eb95c3beabd9f1ee5e820d3d2704fe2967cbe350e20c8ffcd3f0a", size = 10080, upload-time = "2025-02-20T21:01:16.647Z" }, +] + [[package]] name = "camel-ai" -version = "0.2.75a2" +version = "0.2.75a3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama" }, @@ -297,9 +306,9 @@ dependencies = [ { name = "pydantic" }, { name = "tiktoken" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c0/cf/0fbec7b2b29f9cd26f826fd39c04919b0cc4e85aa25494450073d8f5077f/camel_ai-0.2.75a2.tar.gz", hash = "sha256:30e09726b83a4d6dab58b91e74861813a921b6d63ed9711fb62716f04fbb090f", size = 893153, upload-time = "2025-08-08T00:46:24.22Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e9/01/8ef700aa28b7ec0bdb0b2e5d3fa46e8d247ca0c0c5d5a885946a095a8952/camel_ai-0.2.75a3.tar.gz", hash = "sha256:6fac8b64822a02c80de8fc97a19927c535024126d416f5cd0ae0c278c4b43102", size = 893165, upload-time = "2025-08-13T10:31:24.793Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bd/86/158ab4487c4e092eb2404a687baf5df097148fe07bf77a47f3e43b17fbea/camel_ai-0.2.75a2-py3-none-any.whl", hash = "sha256:8605c4c4a00afb6fa0ea1050dbccf28d77e7daee9cb72b9d963ecf1549c1f0bf", size = 1319681, upload-time = "2025-08-08T00:46:22.174Z" }, + { url = "https://files.pythonhosted.org/packages/e4/91/cfd1f438ba94e1f90daa96e40d01bb86e9bc167f8db0d29ff36db9ac9db2/camel_ai-0.2.75a3-py3-none-any.whl", hash = "sha256:a93a6e4a1fa29e1620d89188da3f5cf7c9baa32b944e22ead8b5db25ad987844", size = 1319684, upload-time = "2025-08-13T10:31:22.145Z" }, ] [package.optional-dependencies] @@ -313,6 +322,7 @@ eigent = [ { name = "duckduckgo-search" }, { name = "exa-py" }, { name = "ffmpeg-python" }, + { name = "google-api-python-client" }, { name = "html2text" }, { name = "imageio", extra = ["pyav"] }, { name = "markitdown", extra = ["all"] }, @@ -815,6 +825,77 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/da/71/ae30dadffc90b9006d77af76b393cb9dfbfc9629f339fc1574a1c52e6806/future-1.0.0-py3-none-any.whl", hash = "sha256:929292d34f5872e70396626ef385ec22355a1fae8ad29e1a734c3e43f9fbc216", size = 491326, upload-time = "2024-02-21T11:52:35.956Z" }, ] +[[package]] +name = "google-api-core" +version = "2.25.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "google-auth" }, + { name = "googleapis-common-protos" }, + { name = "proto-plus" }, + { name = "protobuf" }, + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/dc/21/e9d043e88222317afdbdb567165fdbc3b0aad90064c7e0c9eb0ad9955ad8/google_api_core-2.25.1.tar.gz", hash = "sha256:d2aaa0b13c78c61cb3f4282c464c046e45fbd75755683c9c525e6e8f7ed0a5e8", size = 165443, upload-time = "2025-06-12T20:52:20.439Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/14/4b/ead00905132820b623732b175d66354e9d3e69fcf2a5dcdab780664e7896/google_api_core-2.25.1-py3-none-any.whl", hash = "sha256:8a2a56c1fef82987a524371f99f3bd0143702fecc670c72e600c1cda6bf8dbb7", size = 160807, upload-time = "2025-06-12T20:52:19.334Z" }, +] + +[[package]] +name = "google-api-python-client" +version = "2.166.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "google-api-core" }, + { name = "google-auth" }, + { name = "google-auth-httplib2" }, + { name = "httplib2" }, + { name = "uritemplate" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c4/c9/eac7b4e843039f0a54a563c2328d43de6f02e426a11b6a7e378996f667db/google_api_python_client-2.166.0.tar.gz", hash = "sha256:b8cf843bd9d736c134aef76cf1dc7a47c9283a2ef24267b97207b9dd43b30ef7", size = 12680525, upload-time = "2025-03-26T20:15:34.016Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b4/44/ae1528a6ca296d89704c8febb72b3e263c28b4e50ab29b9202df7a0f273d/google_api_python_client-2.166.0-py2.py3-none-any.whl", hash = "sha256:dd8cc74d9fc18538ab05cbd2e93cb4f82382f910c5f6945db06c91f1deae6e45", size = 13190078, upload-time = "2025-03-26T20:15:29.647Z" }, +] + +[[package]] +name = "google-auth" +version = "2.40.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cachetools" }, + { name = "pyasn1-modules" }, + { name = "rsa" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9e/9b/e92ef23b84fa10a64ce4831390b7a4c2e53c0132568d99d4ae61d04c8855/google_auth-2.40.3.tar.gz", hash = "sha256:500c3a29adedeb36ea9cf24b8d10858e152f2412e3ca37829b3fa18e33d63b77", size = 281029, upload-time = "2025-06-04T18:04:57.577Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/17/63/b19553b658a1692443c62bd07e5868adaa0ad746a0751ba62c59568cd45b/google_auth-2.40.3-py2.py3-none-any.whl", hash = "sha256:1370d4593e86213563547f97a92752fc658456fe4514c809544f330fed45a7ca", size = 216137, upload-time = "2025-06-04T18:04:55.573Z" }, +] + +[[package]] +name = "google-auth-httplib2" +version = "0.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "google-auth" }, + { name = "httplib2" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/56/be/217a598a818567b28e859ff087f347475c807a5649296fb5a817c58dacef/google-auth-httplib2-0.2.0.tar.gz", hash = "sha256:38aa7badf48f974f1eb9861794e9c0cb2a0511a4ec0679b1f886d108f5640e05", size = 10842, upload-time = "2023-12-12T17:40:30.722Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/be/8a/fe34d2f3f9470a27b01c9e76226965863f153d5fbe276f83608562e49c04/google_auth_httplib2-0.2.0-py2.py3-none-any.whl", hash = "sha256:b65a0a2123300dd71281a7bf6e64d65a0759287df52729bdd1ae2e47dc311a3d", size = 9253, upload-time = "2023-12-12T17:40:13.055Z" }, +] + +[[package]] +name = "googleapis-common-protos" +version = "1.70.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "protobuf" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/39/24/33db22342cf4a2ea27c9955e6713140fedd51e8b141b5ce5260897020f1a/googleapis_common_protos-1.70.0.tar.gz", hash = "sha256:0e1b44e0ea153e6594f9f394fef15193a68aaaea2d843f83e2742717ca753257", size = 145903, upload-time = "2025-04-14T10:17:02.924Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/86/f1/62a193f0227cf15a920390abe675f386dec35f7ae3ffe6da582d3ade42c7/googleapis_common_protos-1.70.0-py3-none-any.whl", hash = "sha256:b8bfcca8c25a2bb253e0e0b0adaf8c00773e5e6af6fd92397576680b807e0fd8", size = 294530, upload-time = "2025-04-14T10:17:01.271Z" }, +] + [[package]] name = "greenlet" version = "3.2.3" @@ -903,6 +984,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, ] +[[package]] +name = "httplib2" +version = "0.22.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyparsing" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3d/ad/2371116b22d616c194aa25ec410c9c6c37f23599dcd590502b74db197584/httplib2-0.22.0.tar.gz", hash = "sha256:d7a10bc5ef5ab08322488bde8c726eeee5c8618723fdb399597ec58f3d82df81", size = 351116, upload-time = "2023-03-21T22:29:37.214Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a8/6c/d2fbdaaa5959339d53ba38e94c123e4e84b8fbc4b84beb0e70d7c1608486/httplib2-0.22.0-py3-none-any.whl", hash = "sha256:14ae0a53c1ba8f3d37e9e27cf37eabb0fb9980f435ba405d546948b009dd64dc", size = 96854, upload-time = "2023-03-21T22:29:35.683Z" }, +] + [[package]] name = "httptools" version = "0.6.4" @@ -1654,6 +1747,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d9/fd/8d84d75832b0983cecf3aff7ae48362fe96fc8ab6ebca9dcf3cefd87e79c/Protego-0.4.0-py2.py3-none-any.whl", hash = "sha256:37640bc0ebe37572d624453a21381d05e9d86e44f89ff1e81794d185a0491666", size = 8553, upload-time = "2025-01-17T15:48:18.332Z" }, ] +[[package]] +name = "proto-plus" +version = "1.26.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "protobuf" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f4/ac/87285f15f7cce6d4a008f33f1757fb5a13611ea8914eb58c3d0d26243468/proto_plus-1.26.1.tar.gz", hash = "sha256:21a515a4c4c0088a773899e23c7bbade3d18f9c66c73edd4c7ee3816bc96a012", size = 56142, upload-time = "2025-03-10T15:54:38.843Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4e/6d/280c4c2ce28b1593a19ad5239c8b826871fc6ec275c21afc8e1820108039/proto_plus-1.26.1-py3-none-any.whl", hash = "sha256:13285478c2dcf2abb829db158e1047e2f1e8d63a077d94263c2b88b043c75a66", size = 50163, upload-time = "2025-03-10T15:54:37.335Z" }, +] + [[package]] name = "protobuf" version = "5.29.5" @@ -1699,6 +1804,27 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ab/32/340238be1eb5037e7b5de7e640ee22334417239bc347eadefaf8c373936d/pyarrow-20.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:4a8b029a07956b8d7bd742ffca25374dd3f634b35e46cc7a7c3fa4c75b297191", size = 25770759, upload-time = "2025-04-27T12:28:33.702Z" }, ] +[[package]] +name = "pyasn1" +version = "0.6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ba/e9/01f1a64245b89f039897cb0130016d79f77d52669aae6ee7b159a6c4c018/pyasn1-0.6.1.tar.gz", hash = "sha256:6f580d2bdd84365380830acf45550f2511469f673cb4a5ae3857a3170128b034", size = 145322, upload-time = "2024-09-10T22:41:42.55Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c8/f1/d6a797abb14f6283c0ddff96bbdd46937f64122b8c925cab503dd37f8214/pyasn1-0.6.1-py3-none-any.whl", hash = "sha256:0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629", size = 83135, upload-time = "2024-09-11T16:00:36.122Z" }, +] + +[[package]] +name = "pyasn1-modules" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyasn1" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e9/e6/78ebbb10a8c8e4b61a59249394a4a594c1a7af95593dc933a349c8d00964/pyasn1_modules-0.4.2.tar.gz", hash = "sha256:677091de870a80aae844b1ca6134f54652fa2c8c5a52aa396440ac3106e941e6", size = 307892, upload-time = "2025-03-28T02:41:22.17Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/47/8d/d529b5d697919ba8c11ad626e835d4039be708a35b0d22de83a269a6682c/pyasn1_modules-0.4.2-py3-none-any.whl", hash = "sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a", size = 181259, upload-time = "2025-03-28T02:41:19.028Z" }, +] + [[package]] name = "pyautogui" version = "0.9.54" @@ -1916,6 +2042,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/80/28/2659c02301b9500751f8d42f9a6632e1508aa5120de5e43042b8b30f8d5d/pyopenssl-25.1.0-py3-none-any.whl", hash = "sha256:2b11f239acc47ac2e5aca04fd7fa829800aeee22a2eb30d744572a157bd8a1ab", size = 56771, upload-time = "2025-05-17T16:28:29.197Z" }, ] +[[package]] +name = "pyparsing" +version = "3.2.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bb/22/f1129e69d94ffff626bdb5c835506b3a5b4f3d070f17ea295e12c2c6f60f/pyparsing-3.2.3.tar.gz", hash = "sha256:b9c13f1ab8b3b542f72e28f634bad4de758ab3ce4546e4301970ad6fa77c38be", size = 1088608, upload-time = "2025-03-25T05:01:28.114Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/05/e7/df2285f3d08fee213f2d041540fa4fc9ca6c2d44cf36d3a035bf2a8d2bcc/pyparsing-3.2.3-py3-none-any.whl", hash = "sha256:a749938e02d6fd0b59b356ca504a24982314bb090c383e3cf201c95ef7e2bfcf", size = 111120, upload-time = "2025-03-25T05:01:24.908Z" }, +] + [[package]] name = "pyperclip" version = "1.9.0" @@ -2181,6 +2316,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/41/b3/728a08ff6f5e06fe3bb9af2e770e9d5fd20141af45cff8dfc62da4b2d0b3/rpds_py-0.25.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:f73ce1512e04fbe2bc97836e89830d6b4314c171587a99688082d090f934d20a", size = 231651, upload-time = "2025-05-21T12:45:24.72Z" }, ] +[[package]] +name = "rsa" +version = "4.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyasn1" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/da/8a/22b7beea3ee0d44b1916c0c1cb0ee3af23b700b6da9f04991899d0c555d4/rsa-4.9.1.tar.gz", hash = "sha256:e7bdbfdb5497da4c07dfd35530e1a902659db6ff241e39d9953cad06ebd0ae75", size = 29034, upload-time = "2025-04-16T09:51:18.218Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/8d/0133e4eb4beed9e425d9a98ed6e081a55d195481b7632472be1af08d2f6b/rsa-4.9.1-py3-none-any.whl", hash = "sha256:68635866661c6836b8d39430f97a996acbd61bfa49406748ea243539fe239762", size = 34696, upload-time = "2025-04-16T09:51:17.142Z" }, +] + [[package]] name = "rubicon-objc" version = "0.5.1" @@ -2421,6 +2568,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/17/69/cd203477f944c353c31bade965f880aa1061fd6bf05ded0726ca845b6ff7/typing_inspection-0.4.1-py3-none-any.whl", hash = "sha256:389055682238f53b04f7badcb49b989835495a96700ced5dab2d8feae4b26f51", size = 14552, upload-time = "2025-05-21T18:55:22.152Z" }, ] +[[package]] +name = "uritemplate" +version = "4.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/98/60/f174043244c5306c9988380d2cb10009f91563fc4b31293d27e17201af56/uritemplate-4.2.0.tar.gz", hash = "sha256:480c2ed180878955863323eea31b0ede668795de182617fef9c6ca09e6ec9d0e", size = 33267, upload-time = "2025-06-02T15:12:06.318Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a9/99/3ae339466c9183ea5b8ae87b34c0b897eda475d2aec2307cae60e5cd4f29/uritemplate-4.2.0-py3-none-any.whl", hash = "sha256:962201ba1c4edcab02e60f9a0d3821e82dfc5d2d6662a21abd533879bdb8a686", size = 11488, upload-time = "2025-06-02T15:12:03.405Z" }, +] + [[package]] name = "urllib3" version = "2.5.0" diff --git a/electron/main/index.ts b/electron/main/index.ts index 096671fc0..32ae646b3 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -269,7 +269,7 @@ const handleDependencyInstallation = async () => { log.info(' install dependencies success, check tool installed status...'); const isToolInstalled = await checkToolInstalled(); - + log.info('isToolInstalled && !python_process', isToolInstalled && !python_process); if (isToolInstalled && !python_process) { log.info(' tool installed, start backend service...'); python_process = await startBackend((port) => { @@ -304,7 +304,10 @@ const handleDependencyInstallation = async () => { function registerIpcHandlers() { // ==================== basic info handler ==================== - ipcMain.handle('get-browser-port', () => browser_port); + ipcMain.handle('get-browser-port', () => { + log.info('Starting new task') + return browser_port + }); ipcMain.handle('get-app-version', () => app.getVersion()); ipcMain.handle('get-backend-port', () => backendPort); ipcMain.handle('get-system-language', getSystemLanguage); @@ -461,7 +464,7 @@ function registerIpcHandlers() { const { MCP_REMOTE_CONFIG_DIR } = getEmailFolderPath(email); const logFolderName = `task_${sanitizedTaskId}`; const logFolderPath = path.join(MCP_REMOTE_CONFIG_DIR, logFolderName); - + // Check if log folder exists if (!fs.existsSync(logFolderPath)) { return { success: false, error: 'Log folder not found' }; @@ -902,6 +905,8 @@ async function createWindow() { title: 'Eigent', width: 1200, height: 800, + minWidth: 1200, + minHeight: 800, frame: false, transparent: true, vibrancy: 'sidebar', @@ -1041,7 +1046,7 @@ const cleanupPythonProcess = async () => { if (python_process?.pid) { const pid = python_process.pid; log.info('Cleaning up Python process', { pid }); - + await new Promise((resolve) => { kill(pid, 'SIGINT', (err) => { if (err) { @@ -1068,7 +1073,7 @@ const cleanupPythonProcess = async () => { log.error('Error handling port file:', error); } } - + python_process = null; } catch (error) { log.error('Error occurred while cleaning up process:', error); diff --git a/electron/main/init.ts b/electron/main/init.ts index 70dbb7824..ac364dbf8 100644 --- a/electron/main/init.ts +++ b/electron/main/init.ts @@ -426,25 +426,33 @@ function checkPortAvailable(port: number): Promise { export async function killProcessOnPort(port: number): Promise { try { const platform = process.platform; - let command: string; if (platform === 'win32') { - // Windows command to find and kill process - command = ` - for /f "tokens=5" %%a in ('netstat -ano ^| findstr :${port}') do ( - echo Killing PID: %%a - taskkill /F /PID %%a - ) - `; - } else if (platform === 'darwin') { - // macOS command - command = `lsof -ti:${port} | xargs kill -9 2>/dev/null || true`; - } else { - // Linux command - command = `fuser -k ${port}/tcp 2>/dev/null || true`; + // 1. get pid of process listen on port + const { stdout: netstatOut } = await execAsync(`netstat -ano | findstr LISTENING | findstr :${port}`); + const lines = netstatOut.trim().split(/\r?\n/).filter(Boolean); + if (lines.length === 0) { + console.log(`no process listen on port ${port}`); + return true; + } + + // get pid from last field + const pid = lines[0].trim().split(/\s+/).pop(); + if (!pid || isNaN(Number(pid))) { + console.log(`Invalid PID extracted for port ${port}: ${pid}`); + return false; + } + + console.log(`Killing PID: ${pid}`); + await execAsync(`taskkill /F /PID ${pid}`); + } + else if (platform === 'darwin') { + await execAsync(`lsof -ti:${port} | xargs kill -9 2>/dev/null || true`); + } + else { + await execAsync(`fuser -k ${port}/tcp 2>/dev/null || true`); } - await execAsync(command); // Wait a bit for the process to be killed await new Promise(resolve => setTimeout(resolve, 500)); diff --git a/package.json b/package.json index 3d18525b0..84f6ef415 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eigent", - "version": "0.0.48", + "version": "0.0.49", "main": "dist-electron/main/index.js", "description": "Eigent", "author": "Eigent.AI", @@ -69,6 +69,7 @@ "next-themes": "^0.4.6", "papaparse": "^5.5.3", "react-markdown": "^10.1.0", + "react-resizable-panels": "^3.0.4", "react-router-dom": "^7.6.0", "remark-gfm": "^4.0.1", "sonner": "^2.0.6", diff --git a/src/components/ChatBox/BottomInput.tsx b/src/components/ChatBox/BottomInput.tsx index c05e8d281..f56f0f38b 100644 --- a/src/components/ChatBox/BottomInput.tsx +++ b/src/components/ChatBox/BottomInput.tsx @@ -36,6 +36,7 @@ export const BottomInput = ({ privacy, isTakeControl, setIsTakeControl, + useCloudModelInDev }: { message: string; onMessageChange: (v: string) => void; @@ -49,12 +50,13 @@ export const BottomInput = ({ privacy?: boolean; isTakeControl?: boolean; setIsTakeControl?: (v: boolean) => void; + useCloudModelInDev: boolean; }) => { const chatStore = useChatStore(); - const [isConfirm, setIsConfirm] = useState(true); const [hasSubTask, setHasSubTask] = useState(false); + useEffect(() => { const message = chatStore.tasks[ chatStore.activeTaskId as string @@ -111,9 +113,7 @@ export const BottomInput = ({ try { const result = await window.electronAPI.selectFile({ title: "Select File", - filters: [ - { name: "All Files", extensions: ["*"] }, - ], + filters: [{ name: "All Files", extensions: ["*"] }], }); if (result.success && result.files && result.files.length > 0) { @@ -310,7 +310,7 @@ export const BottomInput = ({ ) : (