diff --git a/assistant/package.json b/assistant/package.json index 00e3e8c1..a0817c7b 100644 --- a/assistant/package.json +++ b/assistant/package.json @@ -1,6 +1,6 @@ { "name": "@petercatai/assistant", - "version": "1.0.12", + "version": "1.0.16", "description": "PeterCat Assistant Application", "module": "dist/esm/index.js", "types": "dist/esm/index.d.ts", diff --git a/assistant/src/Assistant/index.tsx b/assistant/src/Assistant/index.tsx index f0403717..a97d3f73 100644 --- a/assistant/src/Assistant/index.tsx +++ b/assistant/src/Assistant/index.tsx @@ -23,9 +23,6 @@ const Assistant = (props: AssistantProps) => { }; const startDrag = (e: { clientY: any; preventDefault: () => void }) => { - if (typeof document === 'undefined') { - return; - } const startY = e.clientY; const initBottom = position.bottom; @@ -46,6 +43,11 @@ const Assistant = (props: AssistantProps) => { e.preventDefault(); // Prevent text selection }; + useEffect(() => { + if (typeof window === 'undefined') { + return; + } + }, []); useEffect(() => { setChatVisible(isVisible); @@ -60,6 +62,9 @@ const Assistant = (props: AssistantProps) => { }, ); + if (typeof window === 'undefined') { + return; + } return (
{ * 命令式初始化 Assistant 组件 */ export function initAssistant(props: AssistantProps) { + useEffect(() => { + if (typeof document === 'undefined') { + return; + } + }, []); const elm = document.createElement('div'); document.body.appendChild(elm); diff --git a/assistant/src/Chat/index.tsx b/assistant/src/Chat/index.tsx index fe729d69..3d0ecf17 100644 --- a/assistant/src/Chat/index.tsx +++ b/assistant/src/Chat/index.tsx @@ -211,7 +211,7 @@ const Chat: FC = memo(
{!hideLogo && } {disabled && ( -
+
)} { - if (typeof window === 'undefined') { + if (typeof window === 'undefined' || typeof document === 'undefined') { return; } const dualScreenLeft = diff --git a/client/.kiwi/en/agreement.md b/client/.kiwi/en/agreement.md new file mode 100644 index 00000000..5c05dab0 --- /dev/null +++ b/client/.kiwi/en/agreement.md @@ -0,0 +1,97 @@ +# PeterCat User Agreement + +Version 20241122 + +The PeterCat User Agreement (hereinafter referred to as the "Agreement") is a valid contract between you and Hangzhou Yunwu Technology Co., Ltd. (hereinafter referred to as "we" or "us") regarding your use of the PeterCat Assistant services (hereinafter referred to as the "Services"). This Agreement aims to inform you of the content of the Services and your rights and obligations in using the Services. Please carefully read the content of this Agreement, especially the bolded sections. If you choose to accept this Agreement by clicking on the web page or other means, it will be deemed that you have agreed to the terms of this Agreement. +If you have any questions about the content of this Agreement or the prompt information on this Services page, please do not proceed to the next step. You can contact us through our customer service email for consultation so that we can explain and illustrate it to you. + +## 1. Our Services + +The Services are internet intelligent technical services provided by us and our affiliates in various forms such as webpages, applications, or others (the specific method subject to actual support of the product). You can use this Services to create your own intelligent Q&A robot for your open-source project and provide automatic Q&A services to customers. We will dynamically adjust the Services content according to user needs, market changes, industry development, and the need for updates to relevant laws and regulations. The specific services content are subject to our actual provision. + +## 2. User Information Collection and Use + +2.1.To use the Services, you agree and authorize us to obtain and use your GitHub account, GitHub Token, and the basic information, Issue information, markdown files and code information of the GitHub repository you configured, etc., to create your own intelligent Q&A robot and answer customer questions, reply to GitHub Issues and conduct code review after the robot is created. + +2.2.After your exclusive intelligent Q&A robot is created, you agree and authorize us to obtain and use all relevant documents, issues and other information in the GitHub repository you configured in real time, as well as the information updated and supplemented from time to time, so as to provide automatic Q&A services to customers after the robot is created and to continuously optimize the robot's capabilities. + +2.3.We support you using your own model token. If you configure your own model token on the Services page, it is deemed that you agree and authorize us to call your model token and public key information from the relevant model Services provider for creating your exclusive intelligent Q&A robot. + +2.4.Please rest assured that we pay attention to the protection of your information, follow the principles of legality, legitimacy, and necessity, and will strictly protect and process your information according to the [PeterCat Privacy Policy](/policy). + +2.5.To continuously improve our Services quality, within the scope permitted by applicable laws and regulations, you understand and agree that we have the right to store and use the information content you provide during the use of the Services, as well as the content input by users using your exclusive intelligent Q&A robot, the content automatically output by the robot, and your feedback on the output content (excluding personal information) for purposes including but not limited to copying, distributing, transmitting, publicly displaying, editing, promoting, relevant research, and robot training optimization. However, we cannot guarantee that the aforementioned content will not be lost or damaged, and we do not have any responsibility for the safety and integrity of the above content. + +## 3. Services Usage Norms + +3.1.Our Services targets do not include individuals under 14 years of age. You should ensure that you are at least 14 years old and have the capacity to act in compliance with the terms of this Agreement. + +3.2.You should ensure that the GitHub account, repository address, and information within the repository, such as documents, model tokens, etc., that you provide are true, accurate, legal, and valid, and that you have obtained all necessary and sufficient authorizations for us to process such content in the agreed manner. To avoid you resubmitting information, you agree that we may legally collect relevant information from other entities and share relevant information with other entities that can legally collect or use your information. If we, on our own or through a third party, find that the information you provide contains security issues or violates applicable laws and regulations, platform rules, etc., we have the right to suspend or terminate the provision of the Services to you, and all legal responsibilities arising therefrom shall be borne by you. + +3.3.You should properly keep your account and password for using the Services, as well as your email and other contact information and communication tools. We identify your identity and instructions through your account and password, and any operation using your account and password is deemed to be your own operation. You agree that any losses and responsibilities arising from the loss, disclosure, theft, or other issues related to your account and password shall be borne by you. + +3.4.You promise to comply with the laws and regulations of your location, Github platform rules and all applicable laws and regulations, platform rules, public order and good customs, social morality and the contents of this Agreement when using this Services, and shall not use this Service to engage in any illegal behavior, or behavior that violates the purpose of this Agreement, or infringes the rights of third parties. + +3.5.After creating your exclusive intelligent Q&A robot, you may apply to list your robot on our Services page's marketplace or deploy it to your webpage or other external channels. We will require you to provide relevant information and take technical or manual measures for review in accordance with laws and regulations, regulatory requirements, and applicable platform rules. If there are security issues or other risks, your robot will not be listed or deployed to external channels. For clarification, our review is only a formal review and does not exempt you from your obligations and responsibilities or create, increase, or aggravate our obligations and responsibilities. + +3.6.After creating your exclusive intelligent Q&A robot and providing services to customers, you shall be solely responsible for fulfilling the obligations of Services providers required by applicable laws and regulations, policies, platform rules, or regulatory agencies, including but not limited to user rights and obligations, personal information protection, etc. You shall be solely responsible for handling and independently bearing all responsibilities for complaints, penalties, disputes, etc., that occur during the use of your exclusive intelligent Q&A robot by users. + +3.7.You shall not expressly or impliedly indicate any joint venture, investment, or partnership with us beyond this Agreement, nor shall you expressly or impliedly indicate that we have any evaluations, guarantees, or assurances for you. Without our written consent, you shall not use the trade names, trademarks, Services marks, corporate names, other logos, identifications, or terminology of us and our affiliated companies for any activities. + +3.8.To ensure a good experience and security of the Services, please use the Services correctly and refrain from: + +- Deleting information about copyright on the software and its copies; +- Copying, modifying, adding, deleting, hooking, or creating any derivative works from the data released by the software or during its operation to any terminal memory, the interactive data between the client and server during software operation, and the system data necessary for software operation, including but not limited to using plugins, external tools, or unauthorized third-party tools or services to access the software and related systems; +- Modifying or falsifying instructions and data during software operation, adding, deleting, or changing software functions or operational effects, or operating or disseminating software or methods for the aforementioned purposes, regardless of whether such actions are for commercial purposes; +- Using the Services through unofficial, unauthorized software, plugins, external tools, or systems, or creating, publishing, or disseminating unofficial, unauthorized software, plugins, external tools, or systems; +- Using automated methods such as unofficial programs, machines, scripts, crawlers, or others to use the Services (including websites related to the Services) or obtain data related to the Services. You may only use the Services through manual operations. +If you wish to participate in collaborative technology development for the Services, please participate through our GitHub open-source community and comply with the relevant open-source license. + +3.9.If you violate laws and regulations, infringe on the intellectual property rights of third parties, or violate the terms of this Agreement when using the Services (including when providing services to clients after creating your exclusive intelligent Q&A robot), we have the right to independently judge and take measures such as issuing warnings, requiring corrections within a time limit, suspending use, deleting or blocking your intelligent Q&A robot, depending on the situation. If your actions cause damage to us, other users, or other third parties, you shall also bear corresponding compensation responsibilities. + +## 4. Intellectual Property Rights + +4.1 All intellectual property rights of the Services and related technical software and all intellectual property rights of derivatives of the aforementioned technical software belong to us or the right holder who enjoys the relevant intellectual property rights according to law. The intellectual property rights of the information content you provide belong to you or the right holder who enjoys the relevant intellectual property rights according to law. You undertake and guarantee that you have full rights or have obtained sufficient authorization for the information content you provide, and that there is no violation of applicable laws and regulations or platform rules, infringement of third-party intellectual property rights or other legitimate rights and interests (including but not limited to intellectual property rights such as copyright, patent rights, and trademark rights, as well as other rights such as personality rights and personal information rights), or content that violates public order and good customs. If any loss is caused to us as a result, you shall bear the compensation liability. + +4.2 If permitted by relevant laws and regulations, within the scope of such permission, you may claim relevant rights based on the output content generated from the information content you provide. You shall handle related intellectual property issues on your own, and we shall not be liable for any losses caused thereby. To avoid doubt, if the information content you provide, user input content, or output content from the intelligent Q&A robot itself contains content for which we or other related right holders enjoy intellectual property rights, then the intellectual property rights of the aforementioned content shall still belong to us or other related right holders. + +## 5. Suspension and Termination of Services + +5.1. You have the right to stop using this Services at any time through the corresponding page of this Services. If you wish to use this Services again after closing it, you will need to re-access this Services and provide or confirm relevant information as prompted on the page. + +5.2. We will continue to strive to provide you with better services. Please understand that in the following circumstances, we may suspend, terminate, or cease providing the Services to you, and you should not require us to bear any legal consequences such as breach of contract liability: + +- You violate laws and regulations, platform rules, or the provisions of this Agreement. +- You use this Services for illegal purposes or engage in behaviors that infringe upon the legitimate rights and interests of others. +- The account you use to log in to this Services has been deactivated or subject to restrictive measures. +- Based on the provisions of laws, regulations, and policies, regulatory requirements, or risk management and control needs. +- We have notified you in advance through announcements or other means of stopping the Services. + +5.3. The provision of this Services is subject to the cooperation between us, our affiliates, and third-party institutions such as technical providers. If the cooperation between third-party institutions and us is terminated, this Services will also be terminated accordingly. + +## 6. Disclaimer + +6.1 You acknowledge and understand that we only provide the underlying technical services related to this Services, and this Services are provided "as is" and "as available" without any form of guarantee. Your use of the Services is at your own risk. + +6.2 In light of the technical limitations of artificial intelligence and algorithms, we do not guarantee the legality, authenticity, accuracy, and completeness of the output content created by your use of this Services. The output content may still contain defects, errors, unreasonableness, or may not fully meet user needs. The output content is for reference only and does not constitute any advice or decision-making for users. Users need to make their own judgments about the output content and bear all risks arising from its use. We are exempt from any legal liability for the output content. You should ensure that users are aware of and understand the aforementioned risks. Any legal liability arising from users' use of the output content should be borne by you or the users, and you should ensure that we are exempt from legal liability arising from users' use of the output content. + +6.3 In the event that you are unable to use the Services due to unforeseen, unavoidable, and insurmountable force majeure events, such as natural disasters (e.g., typhoons, floods, earthquakes, etc.), war, strikes, unrest, hacker attacks, industry policy adjustments, or judicial and governmental restrictions, which are beyond the reasonable control of both parties, we will notify you promptly. We shall be exempted from liability within the scope affected by force majeure. If the force majeure lasts for more than fifteen days, we may notify you to terminate the Services. + +6.4 The normal operation of the relevant functions of this Services depends on network communications, telecommunications equipment and other facilities. If the Services are interrupted or fail due to power supply failure, network failure, attack, virus, interference, hacker, system stability or other security reasons, the two parties will not hold each other responsible, but the party where the failure occurs should take reasonable actions to actively promote the restoration of normal services. + +## 7. Complaints and Reports + +7.1 We attach great importance to the Services quality provided by this Services. If you find that any component of this Services or the output content contains any infringement of your intellectual property rights or other legitimate rights and interests, or if you discover any illegal or irregular behavior, false information, or use that violates this Agreement or the platform rules, you can send relevant complaints or reports to us through our customer service email. After verification, we will take measures to remove or disable relevant content in accordance with Chinese laws, regulations, and government normative documents. Please understand that due to the periodic nature of the optimization and training of artificial intelligence systems, there may be a certain delay in our removal or disabling of some content. + +7.2 If we discover or receive reports or complaints from others that you have violated the provisions of this agreement or platform rules, or are suspected of illegal behavior, you should promptly and effectively address any potential illegal content. If damage is caused to us or third parties, you will bear the corresponding compensation liability. We also have the right to directly delete, block relevant content, and impose penalties on you, including but not limited to warnings, restrictions or prohibitions on the use of some or all functions, Services suspension until termination, etc., and have the right to refuse to provide services to you again. + +## 8. Jurisdiction and Others + +8.1. The formation, effectiveness, performance, and interpretation of this agreement shall be governed by the laws of the People's Republic of China (solely for the purpose of this Agreement, and for the avoidance of doubt, excluding the laws of the Hong Kong Special Administrative Region, Macao Special Administrative Region, and Taiwan Region). You agree and accept that disputes arising from this Agreement shall be subject to the exclusive jurisdiction of the people's court with jurisdiction in Xihu District, Hangzhou City, Zhejiang Province, China. + +8.2. This Agreement includes the main body of the Agreement and all rules that we have published or may publish in the future through the Services page, including the PeterCat Privacy Policy, operating procedures, notices, announcements, etc. (hereinafter collectively referred to as "Rules"). All Rules are an integral part of this Agreement and have the same legal effect as the main body of this agreement. + +8.3. To further improve user experience, we will continuously update the Services, providing users with updates such as version upgrades, functional upgrades, and rule upgrades. This Agreement may also be updated accordingly. We will notify you of updates to this Agreement through announcements, emails, pop-up windows, or other means (hereinafter collectively referred to as "Notices"). The updated content will take effect on the specified date in the aforementioned notices. If you do not agree to the terms of the updated agreement, you have the right to stop using the relevant services. If you continue to use this Services, it indicates that you are willing to accept the changed terms of the agreement. + +8.4. We may change the subject (including addition) according to business adjustments. The changed subject will jointly perform this agreement with you and provide you with this Services. The change of subject will not affect your rights and interests under this Agreement. If you continue to use this Services, it is deemed that you agree that the changed subject will be the executor of this Agreement. + +8.5. This Agreement is prepared and signed in Chinese. Any other language version of this Agreement is provided for reference only. If there is any inconsistency between other language versions and the Chinese version, the Chinese version shall prevail. diff --git a/client/.kiwi/en/app.ts b/client/.kiwi/en/app.ts index 2eb70580..e1d7d49f 100644 --- a/client/.kiwi/en/app.ts +++ b/client/.kiwi/en/app.ts @@ -5,6 +5,9 @@ export default { xiangMuXiangXiXin: 'Please check the documentation for more details', chaKanGengDuo: 'Learn more', maYiKaiYuan: 'Ant Open Source', + agreement: 'User Agreement', + agreementLabel: 'I have read and agree to the User Agreement', + policy: 'Privacy Policy', pETER: 'PeterCat Community', liaoJieGengDuo: 'Learn more', deYiYuQiangDa: diff --git a/client/.kiwi/en/policy.md b/client/.kiwi/en/policy.md new file mode 100644 index 00000000..5b082aa9 --- /dev/null +++ b/client/.kiwi/en/policy.md @@ -0,0 +1,99 @@ +# PeterCat Privacy Policy + +## Overview +This policy will help you understand the following: +1. How we collect personal information +2. How we use Cookies, Beacons, Proxies, and other technologies +3. How we protect personal information +4. How we use personal information +5. How we provide personal information externally +6. How you can exercise your rights regarding personal information +7. Declaration of third-party responsibilities +8. How we protect minors' information +9. Policy updates +10. Others + +The PeterCat Assistant application, services, websites, or other forms (the specific method subject to actual support of the product, collectively referred to as the "Services") are provided by Hangzhou Yunwu Technology Co., Ltd. (hereinafter referred to as "we" or "us"). We respect and protect your privacy. When you use the Services we provide, we will collect, use, provide externally, and protect your personal information in accordance with the PeterCat Privacy Policy (hereinafter referred to as "this Policy"). This Policy is closely related to your use of our Services. Please carefully read the content of this Policy, especially the bolded sections. By clicking to accept this Policy via the internet or other means, you are deemed to have agreed to the terms of this Policy. + +1. How We Collect Personal Information +We collect the following personal information related to you (hereinafter referred to as "personal information"): +1.1. Personal Information Provided by You +When you use our Services or communicate with us, we will collect your personal information, specifically as follows: +- Account Information: We will collect information related to the account you use to access our Services, including but not limited to your GitHub account, GitHub Token, name or nickname, location information, etc. +- Document Information: When you use the Services, we will collect and use the document information you provide, including but not limited to basic information about your configured GitHub repositories, Issue information, markdown files, and code information, etc. +- Communication Information: If you communicate with us, we will collect your contact information and any information content you send. +- Other Information: We may collect other information you may provide to us, such as your model token information. +1.2. Personal Information Automatically Received During Your Use of the Services +When you visit, use, or interact with the Services, we will receive the following information about your visit, use, or interaction: +- Settings Data: All preference settings and personalized settings data when you use the Services, including but not limited to your account settings, language settings, and other custom option settings. +- Device Information: Information about the device you use to access the Services. The information we collect depends on the type of device you use and its settings, including but not limited to your device's Internet Protocol address, browser type, browser version, the pages you visit on our Services, the time and date of your visit, time spent on the page, unique device identifiers, and other device information. +- Chat Records: After you use the Services to create an intelligent Q&A robot, all commands and chat data you or users interact with the intelligent Q&A robot. +1.3. Your Personal Information Collected by Us from Third Parties +- Public Information: We may collect your information from public information channels such as public GitHub repositories. +- Information from Third-Party services Linked to Our Services: When you integrate third-party services with our Services, we may collect information based on your settings for the third-party services, such as your model token and public key information. The information we receive depends on the settings and privacy policies of the third-party entity. We recommend that you carefully review the policies of the third-party entity to understand the information they share with us. + +Please understand that the Services we provide to you are constantly updated and evolving. If significant changes occur in the processing of your personal information due to Services updates, we will separately inform you of the scope, methods, and purposes of information collection through page prompts, interaction processes, or agreement terms. We will use, store, provide externally, and protect your information in accordance with this Policy and the corresponding user agreement; if you choose not to provide the aforementioned information, you may be unable to use certain services or some of them, but this will not affect your use of other services we provide. Additionally, third-party entities may provide services to you through us. When you enter Services pages operated by third-party entities, please note that the relevant services are provided to you by the third-party entity. If the third-party entity collects personal information from you, please carefully read the privacy policy or agreement terms of the third-party entity. + +2. How We Use Cookies, Beacons, Proxies, and Other Technologies +2.1.To provide you with a more seamless access experience, when you visit our website or use our Services, we may use small data files to identify you. This can help you save the step of repeatedly entering information or help you determine the security status of your account. These data files may be Cookies, Flash Cookies, or other local storage provided by your browser or associated applications (hereinafter referred to as "Cookies"). Please understand that some of our Services can only be implemented through the use of Cookies. If your browser or browser add-on services allow, you can modify your acceptance level for Cookies or reject relevant Cookies. The "Help" section of most browser toolbars will tell you how to prevent your browser from accepting new Cookies, how to have your browser notify you when you receive a new Cookie, or how to completely turn off Cookies. Additionally, you can close or delete Flash Cookies and similar data used by browser add-ons by changing the settings of the browser add-on or visiting the provider's webpage. However, this action may affect your secure access to our website and use of related services in some cases. +2.2.Our website may also contain electronic images (hereinafter referred to as "Web Beacons"). Using Web Beacons can help the website calculate users who browse webpages or access certain Cookies. We will collect information about your webpage browsing activities through Web Beacons, such as the address of the page you visited, the location of the referring page you previously visited, your browsing environment, and display settings. +2.3.If you use services provided by a third party rather than us through our website or app, to ensure your account security and provide you with a safer access experience, we may use dedicated network protocols and proxy technologies (hereinafter referred to as "Proxy Technologies"). Using Proxy Technologies can help identify known high-risk sites for us, reducing risks such as phishing and account leakage, while better safeguarding the common interests of you and the third party, and preventing illegal modification of normal Services content between you and the third party you wish to access, such as advertisement injection and illegal content modification caused by insecure routers, illegal base stations, etc. In this process, we may also obtain and store your device's IP address, hardware ID, and the location of the pages you visit. + +3. How We Protect Personal Information +3.1.We only store your personal information for the period necessary to provide you with services and within the period required by laws, regulations and supervisory authorities. After the expiration of the storage period, we will delete or anonymize your personal information in accordance with legal requirements. However, if it is technically difficult to delete the relevant personal information or there are other circumstances that are not suitable for deletion according to law, we will stop processing it except for storage and taking necessary security protection measures. +3.2.To safeguard your information security, after collecting your information, we will take various reasonable and necessary measures to protect it. For example, in the technology development environment, we only use de-identified information for statistical analysis; when providing external research reports, we will de-identify the information contained in the report. We will store de-identified information separately from information that can be used to re-identify individuals to ensure that individuals are not re-identified during subsequent processing of de-identified information. +3.3.Please ensure the safekeeping of your account login name and other identity elements. When you use the Services, we will identify your identity through your account login name and other identity elements. Once you disclose the aforementioned information, you may suffer losses and may be adversely affected. If you discover that your account login name and/or other identity elements may have been or have been disclosed, please immediately contact us so that we can take timely measures to avoid or reduce related losses. + +4. How We Use Personal Information +We may use your personal information for the following purposes: +- To fulfill the contract: To fulfill our obligations to provide you with our Services as agreed in the agreement we signed with you. +- To contact you: To contact you through email or other equivalent electronic communication methods when necessary or reasonable, such as pushing notifications, updates or information communications about the Services, security updates, etc. +- To manage your requests: To process and manage requests you make to us. +- To comply with legal provisions: We may process your personal information in accordance with applicable laws, regulations, or regulatory policies. +- Other purposes: We may use your information for other purposes, such as data analysis, identifying usage trends, determining the effectiveness of our Services, and evaluating and improving our Services and your experience, etc. + +5. How We Provide Personal Information Externally +5.1. Sharing +5.1.1.Business Sharing +We commit to strict confidentiality of your information and only share it with partners such as AI model providers and data Services providers when necessary to provide you with services. +5.1.2.Collaboration Sharing +Based on your account settings, we may share your personal information with other users of the Services and the public. Please be aware that any information you share in a collaborative context may become publicly accessible. When you share personal information with other users or interact in public areas, such information may be viewed by all users and may be publicly distributed externally. +5.1.3.Services Integration +When you integrate third-party services with our Services, we may share your personal information based on your instructions. You are responsible for the data you instruct us to share with third-party services. +5.1.4.Complaint Handling +When you file a complaint against someone else or are complained against, to protect the legitimate rights and interests of you and others, we may provide relevant regulatory authorities with your account information, contact details, and the content of the complaint for timely resolution of disputes, except where such provision is expressly prohibited by laws and regulations. +5.2. Transfer +We will not transfer your personal information to any company, organization, or individual, except in the following cases: +- With your explicit consent in advance; +- According to laws, regulations, or mandatory administrative or judicial requirements; +- In cases involving asset transfers, acquisitions, mergers, reorganizations, or bankruptcy liquidations, if personal information transfer is involved, we will inform you of the relevant situation and require the new company or organization holding your personal information to continue to be bound by this Policy. If the purpose or method of processing personal information is changed, we will require that company or organization to obtain your explicit consent anew. +5.3. Public Disclosure +We may only publicly disclose your personal information in the following circumstances: +- Based on your needs, disclose the specified personal information in the disclosure manner you explicitly agree to; +- When we are required by laws, regulations, or mandatory administrative law enforcement or judicial requirements to provide your personal information, we may publicly disclose your personal information according to the required personal information type and disclosure manner. When receiving requests for such disclosure in compliance with laws and regulations, we will require the presentation of corresponding legal documents, such as subpoenas or assistance investigation letters. +Except for the above situations, we will not publicly disclose your information in principle. If public disclosure is necessary, we will inform you of the purpose of the disclosure, the type of information to be disclosed and the sensitive information that may be involved, and obtain your explicit consent. +5.4. Entrusted Processing +To improve information processing efficiency, reduce costs, or enhance accuracy, we may entrust capable affiliated companies or other professional institutions to process user information on our behalf. However, we will require the entrusted company to comply with strict confidentiality obligations and take effective confidentiality measures through written agreements, etc., and prohibit it from using this information for purposes not authorized by you. When the entrustment relationship is terminated, we will supervise the entrusted institution to no longer store personal information. + +6. How You Can Exercise Your Rights Regarding Personal Information +6.1 We will adopt appropriate technical means to ensure that you can access, copy, supplement, correct, and delete your personal information. You can operate autonomously according to the prompts on the relevant page of the Services or contact us through our customer service email. +6.2 When you meet the agreed Services closure conditions and close the Services, we will delete or anonymize all personal information in your account in accordance with legal requirements and the methods described in "How We Protect Personal Information" in this Policy. +6.3 If you find that our collection and use of your personal information violates laws and regulations or violates the agreement with you, you can contact us through our customer service email. +6.4 Despite the above agreements, we may not be able to respond to your requests when we have legal obligations or legal grounds according to relevant laws, regulations, and regulatory requirements, such as when there is sufficient evidence indicating subjective malice or abuse of rights on your part, or when responding to your request would seriously harm the legitimate rights and interests of other individuals or organizations. +6.5 When we cooperate with third-party institutions to provide you with services, the third-party institutions will inform you of relevant information about personal information processors according to their published privacy policies or other terms you have signed (if any) and strictly protect your information and inform you of ways to exercise your rights regarding personal information in accordance with applicable requirements. Please carefully read the relevant policies and terms; if you have any questions, you can consult the third-party institution based on the Services you use. + +7. Declaration of Third-Party Responsibility +Please note that third-party website operators you visit, third-party services accessed through us, and third parties that receive your personal information through us may have their own privacy protection policies. When you view webpages created by third parties or use applications developed by third parties, these third parties may place their own cookies or web beacons, which are not under our control and whose use is not bound by this Policy. We recommend that you contact them for details about their privacy policies. If you find that webpages created by these third parties or applications developed by third parties pose risks, we recommend that you terminate the relevant operations to protect your legal rights and interests. We cannot control the content or privacy policy of any third-party website or Services, and we do not assume any responsibility for any third-party website or Services. + +8. How We Protect Minors' Information +8.1. We attach great importance to the protection of minors' personal information. We expect minors to use our Services under the guidance of their parents or guardians. We will protect the confidentiality and security of minors' personal information in accordance with relevant national laws and regulations. +8.2. If you are a minor, we recommend that you ask your parents or guardians to read this Policy and use the Services or provide us with your information only with the consent of your parents or guardians. In cases where your information is collected with the consent of your parents or guardians, we will only use or disclose this information when permitted by law, with the explicit consent of your parents or guardians, or when necessary to protect your rights and interests. If your guardian disagrees with your use of the Services or provision of information in accordance with this Policy, please immediately terminate your use of the Services and notify us in a timely manner so that we can take appropriate measures. +8.3. If you are the parent or guardian of a minor, please contact us through our customer service email when you have questions about the processing of personal information of the minor you are protecting. +8.4. Special Note: Our Services targets do not include individuals under 14 years old. We will not intentionally collect personal information of such individuals. If you find that an individual under 14 years old has provided personal information to us, please notify us through our customer service email. + +9. Policy Updates +To further improve user experience, we will continuously update our Services, providing updates such as version upgrades, feature upgrades, and rule upgrades. This Policy may also be updated accordingly. We will notify you of updates to this Policy through announcements, emails, or pop-up windows (collectively referred to as "Notifications"), and the updated content will take effect on the specified date in the aforementioned Notifications. If you disagree with the updated terms, you have the right to stop using the relevant services; if you continue to use our Services, it means that you are willing to accept the changed policy terms. + +10. Others +10.1.If you have any questions about this Policy, you can contact us through our customer service email . +10.2.This Policy is prepared and signed in Chinese. Any other language version of this Policy is provided for reference only. If there is any inconsistency between the other language version and the Chinese version, the Chinese version shall prevail. diff --git a/client/.kiwi/ja/app.ts b/client/.kiwi/ja/app.ts index de084687..a348046d 100644 --- a/client/.kiwi/ja/app.ts +++ b/client/.kiwi/ja/app.ts @@ -5,6 +5,9 @@ export default { xiangMuXiangXiXin: 'プロジェクトの詳細情報はドキュメントでご確認ください', chaKanGengDuo: 'もっと見る', maYiKaiYuan: 'アントオープンソース', + agreement: 'ユーザー契約', + agreementLabel: '私は利用規約を読み、同意しました', + policy: 'プライバシーポリシー', pETER: 'PeterCat コミュニティ', liaoJieGengDuo: '詳細を知る', deYiYuQiangDa: diff --git a/client/.kiwi/ko/app.ts b/client/.kiwi/ko/app.ts index 3102e88b..bfbd68af 100644 --- a/client/.kiwi/ko/app.ts +++ b/client/.kiwi/ko/app.ts @@ -5,6 +5,9 @@ export default { xiangMuXiangXiXin: '프로젝트의 자세한 정보는 문서를 참조하십시오.', chaKanGengDuo: '더 보기', maYiKaiYuan: '앤트 오픈소스', + agreement: '사용자 약관', + agreementLabel: '저는 이용 약관을 읽고 동의합니다', + policy: '개인정보 처리방침', pETER: 'PeterCat 커뮤니티', liaoJieGengDuo: '더 알아보기', deYiYuQiangDa: diff --git a/client/.kiwi/zh-CN/agreement.md b/client/.kiwi/zh-CN/agreement.md new file mode 100644 index 00000000..7e9f51d7 --- /dev/null +++ b/client/.kiwi/zh-CN/agreement.md @@ -0,0 +1,80 @@ +# PeterCat用户协议 + +20241122版本 + +《PeterCat用户协议》(以下简称“本协议”)是您与杭州云坞科技有限公司(以下简称“我们”)就您使用PeterCat智能答疑助手服务(以下简称“本服务”)事宜所订立的有效合约。本协议有助于您了解本服务内容及您使用本服务的权利义务,请您仔细阅读本协议内容,尤其是字体加粗部分。若您通过网络页面点击或其他方式选择接受本协议的,即视为您已同意本协议的约定内容。 +如您对本协议内容或本服务页面提示信息有疑问,请勿进行下一步操作。您可通过我们的客服邮箱 联系我们进行咨询,以便我们为您解释和说明。 + +## 一、服务内容 + +本服务为我们及关联方以网页、应用或其他多种形态方式(具体方式以产品实际支持为准)向您提供的互联网智能技术服务,您可通过本服务创建您的开源项目专属智能答疑机器人并对客提供自动答疑等服务。我们会根据用户需求、市场变化、行业发展、相关法律法规更新的需要动态调整服务内容,具体服务内容以我们实际提供的为准。 + +## 二、用户信息收集与使用 + +1. 为了使用本服务,您同意并授权我们获取并使用您的GitHub账号、GitHub Token,以及您配置的GitHub仓库的基本信息、Issue 信息、markdown文件和代码信息等,用于创建您的专属智能答疑机器人及机器人创建后的对客答疑、GitHub Issue 回复及代码审查等。 +2. 您的专属智能答疑机器人创建后,您同意并授权我们实时获取并使用您配置的GitHub仓库所有相关文档、Issue等信息及其不定期更新、补充的信息,用于机器人创建后对客提供自动答疑等服务以及不断优化机器人能力。 +3. 我们支持您使用自己的模型token,如您在本服务页面配置了自己的模型token,视为您同意并授权我们向相关模型服务单位调用您的模型token和公钥信息,用于创建您的专属智能答疑机器人。 +4. 请您放心,我们重视对您的信息保护,遵循合法、正当、必要的原则,并将依照《PeterCat隐私政策》严格保护及处理您的信息。 +5. 为不断改善我们的服务质量,在适用法律法规允许范围内,您理解并同意,您使用本服务过程中提供的信息内容、以及用户使用您的专属智能答疑机器人输入的内容、机器人自动输出的内容以及您对输出内容的反馈,我们有权对其中不含个人信息的内容进行存储及使用(包括但不限于复制、分发、传送、公开展示、编辑、宣传、推广、相关研究、机器人训练优化等)。但是,我们不能保证上述内容不会丢失或损坏,我们对上述内容的安全性和完整性不承担任何责任。 + +## 三、服务使用规范 + +1. 我们的服务对象不包含未满14周岁的个人,您应保证您的年龄已满14周岁且具有行为能力遵守本协议条款。 +2. 您应保证您提供的GitHub账号、仓库地址及仓库内文档、模型token等信息内容真实、准确、合法、有效,并已获得一切必要充分授权,且我们能以约定方式处理该等内容。为了避免您重复提交信息,您同意我们可以向其他主体合法收集相关信息,以及将相关信息分享给其他可合法收集或使用您信息的主体。如果我们自行或经第三方发现,您提供的信息内容存在安全问题或违反适用法律法规、平台规则等,我们有权暂停、终止向您提供本服务,由此产生的一切法律责任需要由您自行承担。 +3. 您应妥善保管您使用本服务的账号和密码、邮箱等联系方式和通讯工具。我们通过账户、密码识别您的身份及指令,使用您的账户、密码的操作视为您本人的操作。您同意,如果因您的账户、密码遗失、泄露、被盗等所导致的损失及责任由您自行承担。 +4. 您承诺使用本服务时遵守您所在地的法律法规、Github相关平台规则以及所有适用的法律法规、平台规则、公序良俗、社会公德以及本协议内容,不得利用本服务从事任何非法的、或违反本协议目的、或侵犯第三方权益的行为。 +5. 您的专属智能答疑机器人创建后,您可申请将您的机器人上架至我们的服务页面上的市场、或部署至您的网页等外部渠道。我们会根据法律法规、监管要求及适用的平台规则等,要求您提供相关资料并采取技术手段或人工手段进行审核。如果存在安全问题或其他风险,您的机器人将无法上架或部署至外部渠道。为免疑义,我们的审核仅为形式审核,并不因此免除您的义务及责任或产生、增加、加重我们的义务及责任。 +6. 您创建专属智能答疑机器人后对客提供服务时,应当自行负责履行适用法律法规、政策、平台规则或监管机构所要求的服务提供者相关义务,包括但不限于用户权利义务约定、个人信息保护等。用户使用您创建的专属智能答疑机器人过程中发生的投诉、处罚、纠纷等,由您自行负责处理并独立承担全部责任。 +7. 您不得对外明示或暗示地表明与我们有任何的合资、投资或除本协议之外的伙伴关系,也不得明示或暗示我们对您有任何评价、担保或保证。未经我们书面同意,您不得使用我们及我们关联公司的商号、商标、服务标志、企业名称、其他标志、标识、用语等进行任何活动。 +8. 为了保证本服务的良好体验与安全性,请您正确使用本服务,不得: + +(1)删除软件及其副本上关于著作权的信息; + +(2)对软件或者软件运行过程中释放到任何终端内存中的数据、软件运行过程中客户端与服务器端的交互数据,以及软件运行所必需的系统数据,进行复制、修改、增加、删除、挂接运行或创作任何衍生作品,形式包括但不限于使用插件、外挂或非经合法授权的第三方工具/服务接入软件和相关系统; + +(3)修改或伪造软件运行中的指令、数据,增加、删减、变动软件的功能或运行效果,或者将用于上述用途的软件、方法进行运营或向公众传播,无论上述行为是否为商业目的; + +(4)通过非官方开发、授权的软件、插件、外挂、系统使用本服务,或制作、发布、传播非官方开发、授权的软件、插件、外挂、系统; + +(5)自行或允许第三方通过非官方程序、机器、脚本、爬虫、或者其他自动化的方法使用本服务(包括本服务相关的网站)或获取本服务相关数据。您仅可通过本人人工操作的方式来使用本服务。 +如果您希望参与本服务的协作技术开发,请通过我们的GitHub开源社区参与并遵守相关的开源许可。 + +9. 如您使用本服务时(包括您创建专属智能答疑机器人后对客提供服务时)存在违法违规、侵犯第三方知识产权等权益或违反本协议约定的行为,我们有权独立判断并视情况采取警示提醒、限期改正、暂停使用、删除或屏蔽您创建的智能答疑机器人等处置措施,您的行为给我们、其他用户或其他第三方造成损害的,您还应承担相应的赔偿责任。 + +## 四、知识产权 +1. 本服务及相关技术软件的全部知识产权及前述技术软件衍生品的全部知识产权归属于我们或者依法享有相关知识产权的权利人,您提供的信息内容的知识产权归属于您或者依法享有相关知识产权的权利人。您承诺并保证对您提供的信息内容拥有完整权利或已获得充分授权,不存在任何违反适用法律法规或平台规则、侵犯第三方知识产权或其他合法权益(包括但不限于著作权、专利权、商标权等知识产权及人格权、个人信息权益等其他权益)、违反公序良俗的内容,如因此给我们造成的任何损失,由您承担赔偿责任。 +2. 如相关法律法规允许,则在相关允许范围内,您可以主张基于您提供的信息内容而生成的输出内容的相关权利,相关的知识产权问题由您自行处理,我们对由此造成的任何损失不负责任。为免疑义,如您提供的信息内容、用户输入内容、智能答疑机器人输出内容本身包含了我们或其他相关权利人享有知识产权的内容,则前述内容的知识产权仍由我们或其他相关权利人享有。 + +## 五、服务中止、终止 +1. 您有权随时通过本服务相应页面停止使用本服务。如您关闭本服务后希望再次使用本服务,您需要重新访问本服务并按照页面提示提供或确认相关信息。 +2. 我们将不断努力为您提供更好的服务。请您理解,在下列情况下,我们可以暂停、中止或终止向您提供服务,且您不应要求我们承担任何违约责任等法律后果: + +(1)您违反法律法规、平台规则或本协议约定内容; + +(2)您将本服务用于非法目的或利用本服务从事侵害他人合法权益的行为; + +(3)您登录本服务的账户已注销或被采取限制措施; + +(4)基于法律法规及政策的规定、监管机构要求或风险管控的需要; + +(5)我们已提前以公告或其他提示方式通知停止提供服务。 + +3. 本服务的提供受限于我们及关联方与相关技术提供方等第三方机构的合作,如第三方机构与我们的合作终止,本服务也随即终止。 + +## 六、免责声明 +1. 您知悉并理解,我们仅提供本服务相关的底层技术服务,且本服务按“原样”和“现状”提供,我们不提供任何形式的担保,您使用本服务的风险由您自行承担。 +2. 鉴于人工智能、算法的技术局限性,我们不保证您使用本服务创建的专属智能答疑机器人的输出内容的合法性、真实性、准确性以及完整性,输出内容仍可能存在缺陷、错误、不合理或无法完全满足用户的需求等,输出内容仅供参考使用,不构成任何对用户的建议或决策,用户需对输出内容自行加以判断,并承担因使用输出内容引发的所有风险,我们免于为输出内容承担任何法律责任。您应确保用户已知悉并了解前述风险,因用户使用输出内容造成的任何法律责任应由您或用户承担,您应确保我们免于承担用户使用输出内容造成的法律责任。 +3. 由于无法预见、无法避免并无法克服的不可抗力事件,例如自然灾害(如台风、洪水、地震等)、战争、罢工、动乱、黑客攻击、行业政策调整或司法、政府限制等超出双方合理控制范围的突发事件的发生,导致您不能使用服务的,我们将及时通知您,我们在不可抗力影响范围内免除责任。如不可抗力持续十五天以上,我们可能通知您终止服务。 +4. 本服务相关功能正常运行依赖于网络通讯、电信设备等设施,如因电力供应故障、网络故障、攻击、病毒、干扰、黑客、系统稳定性或其他安全原因,导致服务中断或故障的,双方互不追究对方责任,但发生故障的一方应采取合理行动积极促使服务恢复正常。 + +## 七、投诉与举报 +1. 我们高度重视本服务所提供的服务质量,如您发现本服务的任何组成部分或输出内容存在任何涉及侵害您知识产权或其他合法权益的,或者您发现任何违法违规、虚假信息以及违反本协议或平台规则的使用行为,您可通过我们的客服邮箱向我们发送相关投诉或举报材料。我们查证核实后将根据中国法律法规和政府规范性文件采取措施移除或禁用相关内容。请您理解,由于人工智能系统的优化与训练存在一定的周期性,我们对部分内容的移除或禁用操作可能会存在一定的滞后性。 +2. 如果我们发现或收到他人举报或投诉您违反本协议或平台规则约定、或涉嫌违法违规的行为,您应当及时、有效地处理可能存在的违法违规内容,如给我们或第三方造成损害的,您将承担相应赔偿责任。我们亦有权直接对相关内容进行删除、屏蔽,并视行为情节对您处以包括但不限于警告、限制或禁止使用部分或全部功能、服务暂停直至终止等处罚,并有权拒绝再向您提供服务。 + +## 八、管辖及其他 +1. 本协议的成立、生效、履行和解释,均适用中华人民共和国法律(仅为本协议之目的,为避免疑义,不包括香港特别行政区、澳门特别行政区及台湾地区法律)。您同意并接受,因本协议引发的争议由中国浙江省杭州市西湖区有管辖权的人民法院专属管辖。 +2. 本协议内容包括协议正文以及所有我们通过服务页面已经发布的或将来可能发布的各类规则,包括[《PeterCat隐私政策》](/policy)、操作流程、通知、公告等(以下统称“规则”)。所有规则均为本协议不可分割的组成部分,与本协议正文具有同等法律效力。 +3. 为了进一步改善用户体验,我们将会持续更新服务,为用户提供版本升级、功能升级、规则升级等服务和内容的更新,本协议也可能会随之更新。我们会以公告、邮件或弹窗等方式(以下统称“通知”)就本协议的更新向您进行告知,更新内容将在前述通知指定日期开始生效。若您不同意更新后的条款内容,您有权停止使用相关服务;如您继续使用本服务,表示您愿意接受变更后的协议条款。 +4. 我们可能根据业务调整而发生主体变更(含增加),变更后的我方主体将与您共同履行本协议并向您提供本服务,主体的变更不会影响您在本协议项下的权益。如您继续使用本服务的,视为同意变更后的我方主体作为本协议的履行方。 +5. 本协议以中文编制并签署。本协议的任何其他语言版本仅为参考而提供。如果其他语言版本与中文版本之间存在不一致之处,以中文版本为准。 + diff --git a/client/.kiwi/zh-CN/app.ts b/client/.kiwi/zh-CN/app.ts index 608c96d0..327aaa60 100644 --- a/client/.kiwi/zh-CN/app.ts +++ b/client/.kiwi/zh-CN/app.ts @@ -5,6 +5,9 @@ export default { xiangMuXiangXiXin: '项目详细信息请进文档查阅', chaKanGengDuo: '查看更多', maYiKaiYuan: '蚂蚁开源', + agreement: '用户协议', + agreementLabel: '我已阅读并同意用户协议', + policy: '隐私政策', pETER: 'PeterCat 社区', liaoJieGengDuo: '了解更多', deYiYuQiangDa: diff --git a/client/.kiwi/zh-CN/policy.md b/client/.kiwi/zh-CN/policy.md new file mode 100644 index 00000000..37a2d32f --- /dev/null +++ b/client/.kiwi/zh-CN/policy.md @@ -0,0 +1,129 @@ +# PeterCat隐私政策 + +## 概述 + +本政策将帮助您了解以下内容: + +一、我们如何收集个人信息 + +二、我们如何使用Cookie、Beacon、Proxy等技术 + +三、我们如何保护个人信息 + +四、我们如何使用个人信息 + +五、我们如何对外提供个人信息 + +六、您如何实现您的个人信息权利 + +七、对第三方责任的声明 + +八、我们如何保护未成年人的信息 + +九、本政策更新 + +十、其他 + +PeterCat智能答疑助手应用、服务、网页或其他形态方式(具体方式以产品实际支持为准,以下统称 “服务”)由杭州云坞科技有限公司(以下称“我们”)提供。我们尊重并保护您的隐私。在您使用我们提供的服务时,我们将按照《PeterCat隐私政策》(以下简称“本政策”)收集、使用、对外提供及保护您的个人信息。本政策与您使用我们的服务关系紧密,请您仔细阅读本政策内容,尤其是字体加粗部分。若您通过网络页面点击或其他方式选择接受本政策的,即视为您已同意本政策的约定内容。 + +### 一、我们如何收集个人信息 +我们会收集与您相关的以下个人信息(以下简称“个人信息”): + +#### (一)您提供的个人信息 +在您使用我们的服务或与我们进行通信时,我们会收集您的个人信息,具体如下: + +1. 账户信息:我们会收集与您使用我们的服务的账户相关的信息,包括但不限于您的GitHub账号、GitHub Token、姓名或昵称、位置信息等。 +2. 文档信息:在您使用服务时,我们会收集并使用您提供的文档信息,包括但不限于您配置的GitHub仓库的基本信息、Issue 信息、markdown文件和代码信息等。 +3. 通信信息:如果您与我们通信,我们会收集您的联系信息以及您发送的任何信息内容。 +4. 其他信息:我们会收集您可能提供给我们的其他信息,如您的模型token信息等。 + +#### (二)您使用服务期间我们自动接收的个人信息 +在您访问、使用服务或与服务互动时,我们会收到有关您的访问、使用或互动的以下信息: + +1. 设置数据:您使用服务时的所有首选项设置和个性化设置数据,包括但不限于您的账户设置、语言设置和其他自定义选项设置。 +2. 设备信息:您使用服务的设备的信息,我们所收集的信息取决于您使用的设备类型及其设置,包括但不限于您设备的互联网协议地址、浏览器类型、浏览器版本、您访问我们服务的页面、您访问的时间和日期、在页面上停留的时间、唯一设备标识符和其他设备信息。 +3. 聊天记录:您使用服务创建智能答疑机器人后,您或用户与智能答疑机器人交互的所有命令和聊天数据。 + +#### (三)我们从第三方收集的您的个人信息 + +1. 公开信息:我们可能会从公开的 GitHub 仓库等公开信息渠道收集您的信息。 +2. 链接到我们服务的第三方服务信息:当您将第三方服务与我们的服务集成时,我们可能会收集基于您对第三方服务进行的设置的信息,如您的模型token和公钥信息等。我们收到的信息取决于第三方主体的设置和隐私政策,建议您仔细查看第三方主体的政策内容以了解第三方与我们共享的信息。 + +请您理解,我们向您提供的服务是不断更新和发展的。如因服务更新导致您的个人信息处理情况发生重要变更的,我们会通过页面提示、交互流程、协议约定的方式另行向您说明信息收集的范围、方式与目的。我们会按照本政策以及相应的用户协议约定使用、存储、对外提供及保护您的信息;如您选择不提供前述信息,您可能无法使用某项或某部分服务,但不影响您使用我们提供的其他服务。此外,第三方主体可能会通过我们向您提供服务。当您进入第三方主体运营的服务页面时,请注意相关服务由第三方主体向您提供。涉及到第三方主体向您收集个人信息的,请您仔细阅读第三方主体的隐私政策或协议约定。 + +### 二、 我们如何使用Cookie、Beacon、Proxy等技术 + +1. 为使您获得更轻松的访问体验,您访问我们的网站或使用各项服务时,我们可能会通过小型数据文件识别您的身份,这么做可帮您省去重复输入信息的步骤,或者帮助判断您的账号安全状态。这些数据文件可能是Cookie、Flash Cookie、您的浏览器或关联应用程序提供的其他本地存储(以下简称“Cookie”)。请您理解,我们的某些服务只能通过使用Cookie才可得到实现。如您的浏览器或浏览器附加服务允许,您可以修改对Cookie的接受程度或者拒绝相关Cookie。多数浏览器工具条中的“帮助”部分会告诉您怎样防止您的浏览器接受新的Cookie,怎样让您的浏览器在您收到一条新Cookie时通知您或者怎样彻底关闭Cookie。此外,您可以通过改变浏览器附加程序的设置,或通过访问提供商的网页,来关闭或删除浏览器附加程序使用的Flash Cookie及类似数据。但这一举动在某些情况下可能会影响您安全访问我们的网站和使用相关服务。 +2. 我们网站上还可能包含一些电子图像(以下简称 “网络Beacon”),使用网络Beacon可以帮助网站计算浏览网页的用户或访问某些Cookie,我们会通过网络Beacon收集您浏览网页活动的信息,例如:您访问的页面地址、您先前访问的援引页面的位置、您的浏览环境以及显示设定。 +3. 如您通过我们的网站或APP,使用了由第三方而非我们提供的服务时,为尽力确保您的账号安全,使您获得更安全的访问体验,我们可能会使用专用的网络协议及代理技术(以下简称 “Proxy技术”)。使用Proxy技术,可以帮助您识别到我们已知的高风险站点,减少由此引起的钓鱼、账号泄露等风险,同时更有利于保障您和第三方的共同权益,阻止不法分子篡改您和您希望访问的第三方之间正常服务内容,例如:不安全路由器、非法基站等引起的广告注入、非法内容篡改等。在此过程中,我们也可能会获得和保存您设备的IP地址、硬件ID以及您访问的页面位置。 + +### 三、 我们如何保护个人信息 + +1. 我们仅在为您提供服务目的所必需期间和法律法规及监管规定的期限内保存您的个人信息,保存期限届满之后,我们将按照法律要求删除或匿名化处理您的个人信息,但如删除相关个人信息从技术上难以实现或存在其他依法不适宜删除的情形,我们将停止除存储和采取必要的安全保护措施之外的处理。 +2. 为了保障您的信息安全,我们在收集您的信息后,将采取各种合理必要的措施保护您的信息。例如,在技术开发环境当中,我们仅使用经过去标识化处理的信息进行统计分析;对外提供研究报告时,我们将对报告中所包含的信息进行去标识化处理。我们会将去标识化后的信息与可用于恢复识别个人的信息分开存储,确保在针对去标识化信息的后续处理中不重新识别个人。 +3. 请您务必妥善保管好您的账号登录名及其他身份要素。您在使用服务时,我们会通过您的账号登录名及其他身份要素来识别您的身份。一旦您泄漏了前述信息,您可能会蒙受损失,并可能对您产生不利。如您发现账号登录名及/或其他身份要素可能或已经泄露时,请您立即和我们取得联系,以便我们及时采取相应措施以避免或降低相关损失。 + +### 四、 我们如何使用个人信息 +我们可能会将您的个人信息用于以下目的: + +1. 为履行合同:为履行我们与您签署的协议里约定向您提供我们的服务的义务。 +2. 联系您:在必要或合理的情况下通过电子邮件或其他等效的电子通信方式联系您,例如推送通知,有关服务的更新或信息通信、安全更新等。 +3. 管理您的请求:处理并管理您向我们提出的请求。 +4. 遵守法律规定:我们可能会根据适用法律法规或监管政策的要求处理您的个人信息。 +5. 其他目的:我们可能会将您的信息用于其他目的,例如数据分析、识别使用趋势、确定我们服务的有效性以及评估和改进我们的服务和您的体验等。 + +### 五、 我们如何对外提供个人信息 + +#### (一)共享 + +1. 业务共享 +我们承诺对您的信息进行严格保密,我们仅在为您提供服务所必要的情况下与AI模型提供商、数据服务商等合作伙伴共享您的信息。 +2. 协作共享 +根据您的账户设置,我们可能会与服务的其他用户和公众共享您的个人信息。请您注意,您在协作情境下共享的任何信息都有可能变为可供公众访问的信息。您与其他用户共享个人信息或在公共区域进行其他互动时,此类信息可能会被所有用户查看,并可能在外部公开分发。 +3. 服务集成 +当您将第三方服务与我们的服务集成时,我们可能根据您的指示共享您的个人信息。 您对指示我们与第三方服务共享的数据负责。 +4. 投诉处理 +当您投诉他人或被他人投诉时,为了保护您及他人的合法权益,我们可能会将您的账户信息、联系方式、投诉相关内容提供给相关监管机关,以便及时解决投诉纠纷,但法律法规明确禁止提供的除外。 + +#### (二)转移 +我们不会将您的个人信息转移给任何公司、组织和个人,但以下情况除外: + +1. 事先获得您的明确同意; +2. 根据法律法规或强制性的行政或司法要求; +3. 在涉及资产转让、收购、兼并、重组或破产清算时,如涉及到个人信息转移,我们会向您告知有关情况,并要求新的持有您个人信息的公司、组织继续受本政策的约束。如变更个人信息的处理目的、处理方式时,我们将要求该公司、组织重新取得您的明确同意。 + +#### (三)公开披露 +我们仅会在以下情况下,才可能会公开披露您的个人信息: + +1. 根据您的需求,在您明确同意的披露方式下披露您所指定的个人信息; +2. 根据法律法规或强制性的行政执法或司法要求所必须提供您个人信息的情况下,我们可能会依据所要求的个人信息类型和披露方式公开披露您的个人信息。在符合法律法规的前提下,当我们收到上述披露信息的请求时,我们会要求必须出具与之相应的法律文件,如传票或协助调查函。 +除上述情形外,原则上我们不会将您的信息进行公开披露。如确需公开披露时,我们会向您告知公开披露的目的、披露信息的类型及可能涉及的敏感信息,并征得您的明确同意。 + +#### (四)委托处理 +为了提升信息处理效率,降低信息处理成本,或提高信息处理准确性,我们可能会委托有能力的关联公司或其他专业机构代表我们来处理用户信息,但我们会通过书面协议等方式要求受托公司遵守严格的保密义务及采取有效的保密措施,禁止其将这些信息用于未经您授权的用途。在委托关系解除时,我们会监督受托机构不再保存个人信息。 + +### 六、 您如何实现您的个人信息权利 + +1. 我们将采取适当的技术手段,保障您可以查阅、复制、补充、更正和删除您的个人信息。您可以根据相关服务页面提示自助操作,也可以通过我们的客服邮箱联系我们。 +2. 当您符合约定的服务关闭条件并关闭服务后,我们将按照法律要求和本政策中“我们如何保护个人信息”所述的方式删除或匿名化处理您该账号内的所有个人信息。 +3. 如您发现我们收集、使用您个人信息的行为,违反了法律法规规定或违反了与您的约定,您可通过我们的客服邮箱联系我们。 +4. 尽管有上述约定,但按照相关法律法规及监管机构要求,在我们有法律义务或合法依据时我们可能无法响应您的请求,如有充分证据表明您存在主观恶意或滥用权利、或响应您的请求将导致其他个人、组织的合法权益受到严重损害等。 +5. 当我们与第三方机构合作向您提供服务时,第三方机构将按照其发布的隐私权政策或与您签署的其他条款(如有)告知您个人信息处理者的相关信息,并按照适用的要求严格保护您的信息、告知您行使个人信息权利的方式。请您仔细阅读相关政策、条款;如有疑问,可以根据您所使用的服务咨询该第三方机构。 + +### 七、 对第三方责任的声明 +请您注意,您访问的第三方网站经营者、通过我们接入的第三方服务和通过我们接收您的个人信息的第三方可能有自己的隐私权保护政策;当您查看第三方创建的网页或使用第三方开发的应用程序时,这些第三方可能会放置他们自己的Cookie或网络Beacon,这些Cookie或网络Beacon不受我们的控制,且它们的使用不受本政策的约束,建议您与他们联系以获得关于他们的隐私权政策的详细情况。如您发现这些第三方创建的网页或第三方开发的应用程序存在风险时,建议您终止相关操作以保护您的合法权益。我们无法控制任何第三方网站或服务的内容、隐私政策,也不对第三方网站或服务承担任何责任。 + +### 八、 我们如何保护未成年人的信息 + +1. 我们非常重视对未成年人个人信息的保护。我们期望未成年人在父母或监护人指导下使用各项服务。我们将根据国家相关法律法规的规定保护未成年人的个人信息的保密性及安全性。 +2. 如您为未成年人,建议请您的父母或监护人阅读本政策,并在征得您父母或监护人同意的前提下使用各项服务或向我们提供您的信息。对于经父母或监护人同意而收集您的信息的情况,我们只会在法律允许、父母或监护人明确同意或者保护您的权益所必要的情况下使用或公开披露此信息。如您的监护人不同意您按照本政策使用服务或提供信息,请您立即终止使用服务并及时通知我们,以便我们采取相应的措施。 +3. 如您为未成年人的父母或监护人,当您对您所监护的未成年人的个人信息处理存在疑问时,请通过我们的客服邮箱联系我们。 +4. 特别提示:我们的服务对象不包含未满14周岁的个人。我们不会有意收集此类个人的个人信息。 如果您发现有未满14周岁的个人向我们提供了个人信息,请通过我们的客服邮箱通知我们。 + +### 九、 本政策更新 +为了进一步改善用户体验,我们将会持续更新服务,为用户提供版本升级、功能升级、规则升级等服务和内容的更新,本政策也可能会随之更新。我们会以公告、邮件或弹窗等方式(以下统称“通知”)就本政策的更新向您进行告知,更新内容将在前述通知指定日期开始生效。若您不同意更新后的条款内容,您有权停止使用相关服务;如您继续使用本服务,表示您愿意接受变更后的政策条款。 + +### 十、 其他 + +1. 如果您对本隐私政策有任何疑问,您可以通过我们的客服邮箱 联系我们。 +2. 本政策以中文编制并签署。本政策的任何其他语言版本仅为参考而提供。如果其他语言版本与中文版本之间存在不一致之处,以本中文版本为准。 diff --git a/client/.kiwi/zh-TW/app.ts b/client/.kiwi/zh-TW/app.ts index a702fdaf..0a8562c6 100644 --- a/client/.kiwi/zh-TW/app.ts +++ b/client/.kiwi/zh-TW/app.ts @@ -5,6 +5,9 @@ export default { xiangMuXiangXiXin: '項目詳細信息請進文檔查閱', chaKanGengDuo: '查看更多', maYiKaiYuan: '螞蟻開源', + agreement: '用户协议', + agreementLabel: '我已閱讀並同意用戶協議', + policy: '隱私政策', pETER: 'PeterCat 社區', liaoJieGengDuo: '了解更多', deYiYuQiangDa: diff --git a/client/app/agreement/page.tsx b/client/app/agreement/page.tsx new file mode 100644 index 00000000..6fcf14f2 --- /dev/null +++ b/client/app/agreement/page.tsx @@ -0,0 +1,31 @@ +'use client'; + +import React, { useMemo } from 'react'; +import HomeHeader from '@/components/HomeHeader'; +import Markdown from '@/components/Markdown'; +import { useGlobal } from '@/app/contexts/GlobalContext'; +import AgreementZhCN from '../../.kiwi/zh-CN/agreement.md'; +import AgreementEN from '../../.kiwi/en/agreement.md'; + +export default function Agreement() { + const { language } = useGlobal(); + + const markdownContent = useMemo(() => { + switch (language) { + case 'zh-CN': + return AgreementZhCN; + case 'en': + return AgreementEN; + default: + return AgreementEN; + } + }, [language]); + return ( +
+ +
+ +
+
+ ); +} diff --git a/client/app/factory/edit/page.tsx b/client/app/factory/edit/page.tsx index 582ecf80..2923faae 100644 --- a/client/app/factory/edit/page.tsx +++ b/client/app/factory/edit/page.tsx @@ -1,7 +1,20 @@ 'use client'; import I18N from '@/app/utils/I18N'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import { Tabs, Tab, Button, Input, Avatar } from '@nextui-org/react'; +import { + Tabs, + Tab, + Modal, + ModalContent, + ModalHeader, + ModalBody, + ModalFooter, + Button, + Input, + Avatar, + Checkbox, +} from '@nextui-org/react'; +import Image from 'next/image'; import BotCreateFrom from '@/app/factory/edit/components/BotCreateForm'; import { toast, ToastContainer } from 'react-toastify'; import BackIcon from '@/public/icons/BackIcon'; @@ -13,6 +26,7 @@ import { useBotCreate, useBotEdit, } from '@/app/hooks/useBot'; +import { useAgreement } from '@/app/hooks/useAgreement'; import FullPageSkeleton from '@/components/FullPageSkeleton'; import { isEmpty } from 'lodash'; import { Chat } from '@petercatai/assistant'; @@ -30,6 +44,9 @@ import { useSearchParams } from 'next/navigation'; import 'react-toastify/dist/ReactToastify.css'; import { extractFullRepoNameFromGitHubUrl } from '@/app/utils/tools'; import DeployBotModal from './components/DeployBotModal'; +import Markdown from '@/components/Markdown'; +import AgreementZhCN from '../../../.kiwi/zh-CN/agreement.md'; +import AgreementEN from '../../../.kiwi/en/agreement.md'; const API_HOST = process.env.NEXT_PUBLIC_API_DOMAIN; enum VisibleTypeEnum { @@ -42,7 +59,6 @@ enum ConfigTypeEnum { } export default function Edit() { const { language } = useGlobal(); - const { botProfile, setBotProfile } = useBot(); const { user, status } = useUser(); const router = useRouter(); @@ -56,11 +72,31 @@ export default function Edit() { ); const [gitUrl, setGitUrl] = React.useState(''); const [deployModalIsOpen, setDeployModalIsOpen] = useState(false); + const [agreementModalIsOpen, setAgreementModalIsOpen] = useState(false); + const [agreementAccepted, setAgreementAccepted] = + React.useState(true); const apiDomain = process.env.NEXT_PUBLIC_API_DOMAIN; + const markdownContent = useMemo(() => { + switch (language) { + case 'zh-CN': + return AgreementZhCN; + case 'en': + return AgreementEN; + default: + return AgreementEN; + } + }, [language]); + useEffect(() => { if (!user || status !== 'success' || user.id.startsWith('client|')) { router.push(`${apiDomain}/api/auth/login`); + } else { + if (!user?.agreement_accepted) { + setAgreementModalIsOpen(true); + } else { + setAgreementModalIsOpen(false); + } } }, [user, status]); @@ -79,6 +115,13 @@ export default function Edit() { error: createError, } = useBotCreate(); + const { + acceptAgreement: onAcceptAgreement, + isLoading: acceptAgreementLoading, + isSuccess: acceptAgreementSuccess, + error: acceptAgreementError, + } = useAgreement(); + const { data: generatorResponseData, getBotInfoByRepoName, @@ -159,6 +202,19 @@ export default function Edit() { }); }, [generatorResponseData]); + useEffect(() => { + if (acceptAgreementSuccess) { + toast.error('An error has occurred'); + setAgreementModalIsOpen(true); + } + }, [acceptAgreementError]); + + useEffect(() => { + if (acceptAgreementSuccess) { + setAgreementModalIsOpen(false); + } + }, [acceptAgreementSuccess]); + useEffect(() => { if (createSuccess) { setDeployModalIsOpen(true); @@ -219,27 +275,29 @@ export default function Edit() { const chatConfigContent = (
- { - const data = result?.data; - updateConfigFromChatResult(data); - }} - /> + {typeof window !== 'undefined' && ( + { + const data = result?.data; + updateConfigFromChatResult(data); + }} + /> + )}
); const manualConfigLabel = ( @@ -350,168 +408,259 @@ export default function Edit() { return (
- - {visibleType === VisibleTypeEnum.BOT_CONFIG ? ( -
-
-
-
-
- - - + <> + + {visibleType === VisibleTypeEnum.BOT_CONFIG ? ( +
+
+
+
- - {botProfile?.name!} + + + +
+ + {botProfile?.name!} +
+
+
+ + setActiveTab(`${key}` as ConfigTypeEnum) + } + classNames={{ + base: 'min-w-[230px] h-[36px]', + tab: 'shadow-none h-[36px] px-0 py-0', + tabContent: + 'group-data-[selected=true]:bg-[#FAE4CB] rounded-full px-3 py-2 h-[36px]', + cursor: 'shadow-none rounded-full ', + }} + > + + + + {I18N.edit.page.duiHuaTiaoShi} + +
+ } + /> + + + + + {I18N.edit.page.shouDongPeiZhi} + +
+ } + /> +
-
- - setActiveTab(`${key}` as ConfigTypeEnum) - } - classNames={{ - base: 'min-w-[230px] h-[36px]', - tab: 'shadow-none h-[36px] px-0 py-0', - tabContent: - 'group-data-[selected=true]:bg-[#FAE4CB] rounded-full px-3 py-2 h-[36px]', - cursor: 'shadow-none rounded-full ', +
+
- - - - {I18N.edit.page.duiHuaTiaoShi} - -
- } - /> - - - - - {I18N.edit.page.shouDongPeiZhi} - -
- } - /> -
+ {chatConfigContent} +
+
+ {manualConfigContent} +
-
-
- {chatConfigContent} +
+
+
+
+
+
{I18N.edit.page.yuLanYuCeShi}
-
- {manualConfigContent} +
+
-
-
-
-
-
-
-
{I18N.edit.page.yuLanYuCeShi}
-
-
- -
-
-
-
- +
+
+ {typeof window !== 'undefined' && ( + + )} +
+ { + setDeployModalIsOpen(false); + }} + />
- { - setDeployModalIsOpen(false); + ) : ( + <> + )} + {visibleType === VisibleTypeEnum.KNOWLEDGE_DETAIL ? ( + { + setVisibleType(VisibleTypeEnum.BOT_CONFIG); }} - /> -
- ) : ( - <> - )} + > + ) : ( + <> + )} + - {visibleType === VisibleTypeEnum.KNOWLEDGE_DETAIL ? ( - { - setVisibleType(VisibleTypeEnum.BOT_CONFIG); - }} - > - ) : ( - <> - )} + + + {() => ( + <> + +
+ icon +
+ {I18N.app.page.agreement} +
+
+
+ +
+ +
+
+ +
+ { + setAgreementAccepted(e.target.checked); + }} + radius="sm" + color="default" + > + {I18N.app.page.agreementLabel} + +
+
+ + +
+
+ + )} +
+
); diff --git a/client/app/globals.css b/client/app/globals.css index 2680f1ea..a93d9b1c 100644 --- a/client/app/globals.css +++ b/client/app/globals.css @@ -2,15 +2,18 @@ @tailwind components; @tailwind utilities; +html { + background-color: #000 !important; +} + html, body { - background: #F3F4F6; + background: #000; min-height: 100vh !important; margin: 0; padding: 0; } body { color: #131318; - background: #F3F4F6; } body input, @@ -19,7 +22,7 @@ body textarea { } a { - color: #2d7bd4; + color: #1D4ED8; text-decoration: none; } @@ -156,3 +159,83 @@ li { div.fp-watermark { display: none; } + +.markdown { + h1, h2, h3, h4, h5, h6, li, p { + color: rgba(255, 255, 255, 0.9); + } + h1 { + font-weight: 600; + font-size: 30px; + + line-height: 38px; + } + + h2 { + margin: 40px 0 16px 0; + + } + + h3 { + margin: 16px 0; + } + + img { + max-width: 750px; + width: 100%; + } + + p { + font-weight: 400; + font-size: 14px; + letter-spacing: 0; + line-height: 28px; + } + + ul { + list-style: disc; + padding-left: 2em; + + li { + margin-bottom: 4px; + font-size: 14px; + line-height: 24px; + list-style: inherit; + } + } + + blockquote { + padding: 0 16px; + color: #d8d6d6; + border-left: 4px solid #ddd; + } + + table { + display: table; + max-width: 100% !important; + width: 100%; + margin: 24px 0 20px 0; + table-layout: fixed; + border: 1px solid rgba(105, 122, 140, 0.1); + + tr { + background-color: #fff; + box-shadow: 0 1px 0 0 rgba(105, 122, 140, 0.1); + } + + th { + padding: 6px 12px; + border: 1px solid rgba(105, 122, 140, 0.1); + background-color: #fafbfc; + text-align: center; + } + + td { + border: 1px solid rgba(105, 122, 140, 0.1); + padding: 6px 12px; + word-break: break-word; + text-align: left; + } + } + +} diff --git a/client/app/hooks/useAgreement.ts b/client/app/hooks/useAgreement.ts new file mode 100644 index 00000000..9a56cf2f --- /dev/null +++ b/client/app/hooks/useAgreement.ts @@ -0,0 +1,15 @@ +import { useMutation } from '@tanstack/react-query'; +import { acceptAgreement } from '@/app/services/UserController'; +export function useAgreement() { + const mutation = useMutation({ + mutationFn: acceptAgreement, + }); + + return { + data: mutation.data, + acceptAgreement: mutation.mutate, + isLoading: mutation.isPending, + error: mutation.error, + isSuccess: mutation.isSuccess, + }; +} diff --git a/client/app/layout.tsx b/client/app/layout.tsx index 72221698..16e91345 100644 --- a/client/app/layout.tsx +++ b/client/app/layout.tsx @@ -32,10 +32,12 @@ export default function RootLayout({ - {pathname === '/' ? ( + {pathname === '/' || + pathname === '/policy' || + pathname === '/agreement' ? ( children ) : ( -
+
{children}
diff --git a/client/app/market/page.tsx b/client/app/market/page.tsx index fd39acbf..cc16aab4 100644 --- a/client/app/market/page.tsx +++ b/client/app/market/page.tsx @@ -71,14 +71,16 @@ export default function Market() { ))}
- + {typeof window !== 'undefined' && ( + + )}
); } diff --git a/client/app/page.tsx b/client/app/page.tsx index 87cc7d44..f0e29a28 100644 --- a/client/app/page.tsx +++ b/client/app/page.tsx @@ -1,26 +1,17 @@ 'use client'; - +import dynamic from 'next/dynamic'; import React from 'react'; -import { - RefObject, - Suspense, - useCallback, - useEffect, - useRef, - useState, -} from 'react'; +import { RefObject, useCallback, useEffect, useRef, useState } from 'react'; import I18N from '@/app/utils/I18N'; import Image from 'next/image'; import Fullpage, { fullpageOptions } from '@fullpage/react-fullpage'; -import Lottie, { LottieRefCurrentProps } from 'lottie-react'; +import { LottieRefCurrentProps } from 'lottie-react'; import LottieLightningCat from '@/app/assets/lightning_cat.json'; import LottieHelixCat from '@/app/assets/helix_cat.json'; import LottieOctopusCat from '@/app/assets/octopus_cat.json'; -import GitHubIcon from '@/public/icons/GitHubIcon'; -import MenuIcon from '@/public/icons/MenuIcon'; -import StarIcon from '@/public/icons/StarIcon'; -import LanguageSwitcher from '@/components/LangSwitcher'; -import GitHubStars from '@/components/GitHubStars'; +import HomeHeader from '@/components/HomeHeader'; + +const Lottie = dynamic(() => import('lottie-react'), { ssr: false }); // play same video util refresh page const PC_EXAMPLE_VIDEO = [ @@ -118,19 +109,6 @@ export default function Homepage() { const tableRef = useRef(null); const showCaseRef = useRef(null); const [videos, setVideos] = useState<{ pc: string; mobile: string }>(); - const [stars, setStars] = useState(null); - const [showMobileNav, setShowMobileNav] = useState(false); - - useEffect(() => { - async function getStars() { - const starsData = await GitHubStars(); - setStars(starsData); - } - - if (stars === null) { - getStars(); - } - }, [stars]); const scrollHandler = useCallback< NonNullable @@ -280,82 +258,7 @@ export default function Homepage() { render={() => (
-
- - petercat - - - -
+ diff --git a/client/app/policy/page.tsx b/client/app/policy/page.tsx new file mode 100644 index 00000000..e246d034 --- /dev/null +++ b/client/app/policy/page.tsx @@ -0,0 +1,32 @@ +'use client'; + +import React, { useMemo } from 'react'; +import HomeHeader from '@/components/HomeHeader'; +import Markdown from '@/components/Markdown'; +import { useGlobal } from '@/app/contexts/GlobalContext'; + +import PolicyZhCN from '../../.kiwi/zh-CN/policy.md'; +import PolicyEN from '../../.kiwi/en/policy.md'; + +export default function Policy() { + const { language } = useGlobal(); + + const markdownContent = useMemo(() => { + switch (language) { + case 'zh-CN': + return PolicyZhCN; + case 'en': + return PolicyEN; + default: + return PolicyEN; + } + }, [language]); + return ( +
+ +
+ +
+
+ ); +} diff --git a/client/app/services/UserController.ts b/client/app/services/UserController.ts index b5c24cc0..08f1742d 100644 --- a/client/app/services/UserController.ts +++ b/client/app/services/UserController.ts @@ -3,18 +3,33 @@ import axios from 'axios'; const apiDomain = process.env.NEXT_PUBLIC_API_DOMAIN; // Get the public bot profile by id -export async function getUserInfo({ clientId }: { clientId?: string }) { - const response = await axios.get(`${apiDomain}/api/auth/userinfo?clientId=${clientId}`, { withCredentials: true }); +export async function getUserInfo({ clientId }: { clientId?: string }) { + const response = await axios.get( + `${apiDomain}/api/auth/userinfo?clientId=${clientId}`, + { withCredentials: true }, + ); return response.data.data; } +export async function acceptAgreement() { + const response = await axios.post( + `${apiDomain}/api/auth/accept/agreement`, + {}, + { withCredentials: true }, + ); + return response.data; +} export async function getAvaliableLLMs() { - const response = await axios.get(`${apiDomain}/api/user/llms`, { withCredentials: true }); + const response = await axios.get(`${apiDomain}/api/user/llms`, { + withCredentials: true, + }); return response.data; } export async function requestLogout() { - const response = await axios.get(`${apiDomain}/api/auth/logout`, { withCredentials: true }); + const response = await axios.get(`${apiDomain}/api/auth/logout`, { + withCredentials: true, + }); return response.data; -} \ No newline at end of file +} diff --git a/client/components/HomeHeader.tsx b/client/components/HomeHeader.tsx new file mode 100644 index 00000000..f2fead32 --- /dev/null +++ b/client/components/HomeHeader.tsx @@ -0,0 +1,107 @@ +'use client'; +import React, { Suspense, useState, useEffect } from 'react'; +import GitHubIcon from '@/public/icons/GitHubIcon'; +import MenuIcon from '@/public/icons/MenuIcon'; +import StarIcon from '@/public/icons/StarIcon'; +import Image from 'next/image'; +import I18N from '@/app/utils/I18N'; +import { Link } from '@nextui-org/react'; +import GitHubStars from '@/components/GitHubStars'; +import LanguageSwitcher from '@/components/LangSwitcher'; + +const HomeHeader = () => { + const [showMobileNav, setShowMobileNav] = useState(false); + const [stars, setStars] = useState(null); + useEffect(() => { + async function getStars() { + const starsData = await GitHubStars(); + setStars(starsData); + } + + if (stars === null) { + getStars(); + } + }, [stars]); + return ( +
+ + + + + + + +
+ ); +}; + +export default HomeHeader; diff --git a/client/components/Markdown.tsx b/client/components/Markdown.tsx new file mode 100644 index 00000000..2f6ba49b --- /dev/null +++ b/client/components/Markdown.tsx @@ -0,0 +1,29 @@ +'use client'; +import React, { useEffect, useState } from 'react'; +import { remark } from 'remark'; +import html from 'remark-html'; + +const Markdown: React.FC<{ markdownContent: string; theme?: boolean }> = ({ + markdownContent, + theme = true, +}) => { + const [content, setContent] = useState(''); + + useEffect(() => { + const processMarkdown = async () => { + const processedContent = await remark() + .use(html) + .process(markdownContent); + setContent(processedContent.toString()); + }; + processMarkdown(); + }, [markdownContent]); + return ( +
+ ); +}; + +export default Markdown; diff --git a/client/components/Navbar.tsx b/client/components/Navbar.tsx index 3eee9939..dab2ca71 100644 --- a/client/components/Navbar.tsx +++ b/client/components/Navbar.tsx @@ -9,7 +9,6 @@ import { ShopIcon } from '@/public/icons/ShopIcon'; import { SpaceIcon } from '@/public/icons/SpaceIcon'; import { SearchIcon } from '@/public/icons/SearchIcon'; import { AddIcon } from '@/public/icons/AddIcon'; -import PublishBotEntity from './PublishBotEntity'; import { useGlobal } from '@/app/contexts/GlobalContext'; import LanguageSwitcher from '@/components/LangSwitcher'; @@ -116,7 +115,6 @@ export function Navbar() {
{pathname !== '/' && } - {!pathname.includes('/factory/list') && } {pathname.includes('/factory/list') && (