From 472af9722eb6585f7bbdbff11171de9406550c71 Mon Sep 17 00:00:00 2001 From: shenmo Date: Fri, 30 Oct 2026 19:37:02 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=88=9D=E5=A7=8B=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E4=B8=8E=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - docs/PLAN.md: GXDE 小埃同学 v0.2 方案(传送门原生 drop、暂存区、内容工厂、待办、Chat、k9) - README.md: 项目介绍 - LICENSE: GPL-3.0-or-later --- .gitignore | 25 ++++ LICENSE | 232 +++++++++++++++++++++++++++++ README.md | 136 +++++++++++++++++ docs/PLAN.md | 412 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 805 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 docs/PLAN.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..793cba8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# build +build/ +build-*/ +cmake-build-*/ +compile_commands.json +CMakeUserPresets.json + +# editor +.idea/ +.vscode/ +*.swp +*~ + +# qt +*.moc +moc_*.cpp +qrc_*.cpp +ui_*.h +*.qm + +# misc +*.o +*.so +*.a +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bc459ce --- /dev/null +++ b/LICENSE @@ -0,0 +1,232 @@ +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. + +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. + + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. + + flake-wm + Copyright (C) 2026 CharOfString + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: + + flake-wm Copyright (C) 2026 CharOfString + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . + +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . diff --git a/README.md b/README.md new file mode 100644 index 0000000..06422f4 --- /dev/null +++ b/README.md @@ -0,0 +1,136 @@ +# GXDE 小埃同学 · GXDE AI See + +> **拖一下,世界就到你手边。** + +**GXDE 小埃同学** 是 GXDE 桌面的常驻 AI 助手与拖拽中枢。 +它把「拖拽」变成贯穿整个桌面的动作:拖到 **传送门**,选一个窗口,内容就落进那个窗口的输入框; +拖到 **内容工厂**,按类型分词、提链接、翻译、OCR、加待办、问小埃;拖进 **暂存区**,东西先放着,随时再拖出去。 + +> 当前状态:**方案评审中(v0.2)**,代码尚未开始。设计文档见 [docs/PLAN.md](docs/PLAN.md)。 + +--- + +## ✨ 它能做什么 + +### 🌀 传送门 Portal + +- 拖起文件 / 文字 / 图片时,右下角淡入双栏面板(DBlur 毛玻璃、置顶、不进 dock、不抢焦点)。 +- 把内容拖到「传送门」上,桌面**爆炸平铺**(复用 GXDE 的 Win+A 全窗口视图)。 +- 把内容拖到任意窗口的缩略图上松手 —— **原生 drop**,直接落进那个窗口的输入框 / 拖放区。 +- 不是剪贴板 + Ctrl+V:目标窗口收到的是一次真正的拖放,落点就是鼠标位置。 + +### 🗂 暂存区 + +- 文件、文字、图片都能暂存;复选框、缩略图、名称、关闭按钮。 +- 拖动排序、拖出到任意 App、拖进传送门;从暂存区跃迁后条目仍然保留。 +- 高度随内容增长,最高 1/3 屏,超出滚动;可手调、可固定。 +- 文件消失自动清理;重启后恢复(JSON 持久化)。 + +### 🔧 内容工厂 + +拖动时按内容类型出现在面板下方,朝有空间的方向展开: + +| 类型 | 动作 | +| --- | --- | +| 文本 / Office | 打开、分词、提取链接、翻译、朗读、添加到待办、问问小埃 | +| 图片 | 打开、OCR、提取文字、提取主色、生成描述、添加到待办、问问小埃 | +| 音频 | 打开、转文字、时长/码率信息、添加到待办、问问小埃 | +| 其他 | 打开、添加到待办、问问小埃 | + +### ✅ 待办 + +可选置顶、可拖动、不进任务栏的小窗口;和暂存区共用一套列表交互。 + +### 💬 小埃同学 Chat + +- DeepSeek 官方 API 预设 + 自定义 API;首次使用引导开通并填 Key。 +- 多对话管理、流式输出、Markdown、代码块。 +- 编辑消息、重试、从任意消息 fork。 +- 上下文长度设置 + 手动/自动压缩。 +- MCP(stdio)工具接入。 +- 独立桌面入口;后续作为 GXDE 各项能力的 AI 入口与 skill 平台。 + +--- + +## 🧠 它是怎么工作的 + +``` +用户拖拽 + │ + ├─▶ 合成器检测到 drag 开始 ──▶ 面板淡入 + │ + ├─▶ 拖到「传送门」 + │ └─▶ 合成器进入 portal 模式:窗口缩略图爆炸平铺 + │ └─▶ 光标悬停时把 drag 焦点按缩略图坐标重定向到真实窗口 + │ └─▶ 松手 = 原生 drop 进目标窗口的输入框 + │ + ├─▶ 拖到「暂存区」 ──▶ 加入列队(文件 / 文字 / 图片) + │ + └─▶ 拖到「内容工厂」──▶ 按类型展开动作 +``` + +核心是两个决定: + +1. **原生 drop,不是粘贴模拟**。合成器在 hover 时把拖拽焦点按缩略图坐标映射到真实窗口, + 目标 App 自己判断落点在哪个输入框,松手是一次真正的 `wl_data_device.drop`。 +2. **合成器只负责「画」和「转交」**。小埃同学不读取别人的拖拽数据,也不需要剪贴板。 + +需要 GXDE 的 Wayland 合成器(flake-wm / gxde-wlcom)配合;其他环境会自动降级为 +「窗口图标网格 + 激活目标窗口」的模式,X11 后续支持。 + +--- + +## 🧩 组成 + +| 组件 | 说明 | +| --- | --- | +| `gxde-ai-see` | Qt6 + DTK2 的常驻应用(面板 / 暂存区 / 内容工厂 / 待办 / 聊天) | +| `flake-wm` / `gxde-wlcom` 的 `gxde-portal` 模块 | 拖拽监听、爆炸平铺、原生 drop | +| `gxde-k9` | 开机自启与后台保活(可开关) | + +--- + +## 🚧 路线图 + +| 阶段 | 内容 | +| --- | --- | +| M0 | 技术验证:portal grab + 原生 drop | +| M1 | 应用骨架 + 面板 + 暂存区 | +| M2 | 合成器 portal 模块 + 端到端 | +| M3 | 内容工厂 + 待办 | +| M4 | 小埃同学 Chat | +| M5 | MCP / 压缩 / skill | +| M6 | 打包、k9、i18n、关于 | + +--- + +## 🔨 构建 + +尚未开始编码;构建说明会在 M1 完成后补充: + +```bash +cmake -B build -G Ninja +cmake --build build +``` + +依赖(计划):Qt 6.8、dtk2widget 6、LayerShellQt 6、Wayland、ICU、SQLite。 + +--- + +## 📄 文档 + +- [设计方案(v0.2)](docs/PLAN.md) + +--- + +## 📜 许可证 + +GPL-3.0-or-later。见 [LICENSE](LICENSE)。 + +--- + +## 🔗 相关 + +- GXDE OS: +- flake-wm: +- gxde-k9: diff --git a/docs/PLAN.md b/docs/PLAN.md new file mode 100644 index 0000000..ebfd950 --- /dev/null +++ b/docs/PLAN.md @@ -0,0 +1,412 @@ +# GXDE 小埃同学 · 设计方案 + +> 项目:GXDE AI See(小埃同学) +> 版本:v0.2(方案评审稿) +> 日期:2026-10-30 +> 仓库: +> 状态:**方案评审中,确认后开始编码** + +--- + +## 1. 一句话 + +**拖一下,世界就到你手边。** + +小埃同学是 GXDE 桌面的常驻 AI 助手。它把「拖拽」变成一个贯穿桌面的动作: +拖到**传送门**,选一个窗口,内容就落进那个窗口的输入框; +拖到**内容工厂**,按文件类型分词、提链接、翻译、OCR、加待办、问小埃; +拖进**暂存区**,东西就先放着,随时再拖出去。 + +--- + +## 2. 产品组成 + +一个常驻进程(`gxde-ai-see`),四个模块 + 一个聊天客户端: + +| 模块 | 说明 | 入口 | +| --- | --- | --- | +| **传送门 Portal** | 拖拽暂存面板 + 原生 drop 到目标窗口 | 拖拽开始时自动出现 | +| **内容工厂 Factory** | 按内容类型提供动作 | 拖动时出现在面板下方 | +| **待办 Todo** | 可选置顶、可拖动、不进任务栏的小窗口 | 面板菜单 / 内容工厂 | +| **小埃同学 Chat** | DTK2 AI 聊天(DeepSeek / 自定义 API / MCP) | 独立 desktop 入口、传送门里的「问问小埃」 | + +三者共享一套存储与 UI 组件;聊天是独立窗口,传送门是常驻面板。 + +``` + ┌─────────────────────────────┐ + 拖拽开始 ──────▶ │ 传送门面板(右下角,常驻) │ + │ ┌─────────┐ ┌──────────┐ │ + │ │ 传送门 │ │ 暂存区 │ │ + │ │ │ │ 列表 │ │ + │ └─────────┘ └──────────┘ │ + │ ┌─────────────────────────┐│ + │ │ 🔧 内容工厂(按类型出现) ││ + │ └─────────────────────────┘│ + └──────────────┬──────────────┘ + │ + ┌──────────────┴──────────────┐ + │ 合成器 portal(爆炸平铺) │ + │ 原生 drop 到目标窗口输入框 │ + └─────────────────────────────┘ +``` + +--- + +## 3. 设计原则 + +1. **原生优先**:能用 Wayland/X11 原生协议完成的,不自己模拟。 + 传送门的落点用**原生 DnD**,不是剪贴板 + Ctrl+V。 +2. **不抢焦点、不打扰**:面板不进入 dock,不抢键盘焦点,不打断用户正在做的事。 +3. **不监听剪贴板**:暂存区不是剪贴板管理器,只收用户主动拖入的内容。 +4. **可降级**:没有 GXDE portal 合成器时功能降级但程序可用,不崩溃、不反复重启。 +5. **数据可恢复**:暂存区、待办、对话都持久化;文件消失自动清理。 + +--- + +## 4. 传送门(核心) + +### 4.1 用户流程 + +``` +用户拖起文件/文字/图片 + └─▶ 面板在右下角淡入(暂存区为空时才需要弹;非空时本来就常显) + ├─▶ 松手在「暂存区」:加入暂存区列表 + ├─▶ 松手在「内容工厂」:展开动作,松手在某个动作上执行 + └─▶ 悬停「传送门」约 150ms:进入爆炸平铺(portal 模式) + └─▶ 鼠标移到某个窗口缩略图上 + └─▶ 松手:内容**原生 drop** 进该窗口的输入框 / 拖放区 + └─▶ 关闭平铺、恢复窗口状态、激活目标窗口 +``` + +### 4.2 为什么不用剪贴板 + Ctrl+V + +剪贴板只能粘贴到**当前焦点**控件,无法命中「鼠标下的那个输入框」; +而且会污染用户剪贴板、需要还原、需要处理图片/文件多 MIME。 +原生 drop 由目标 App 自己决定在哪个控件、以什么形式接收——这正是用户 +说的「把文件 drop 到输入框本身就是粘贴的结果」。 + +### 4.3 原生 drop 的实现(关键设计) + +Wayland 的拖拽目标由合成器内部的 `wlr_drag->focus` 决定。目标 App 只有在 +收到 `wl_data_device.enter` 后才会 `accept`,松手时才收到 `drop`。 + +我们**不修改 wlroots**,只在合成器里做三件事: + +1. **portal 模式下的 present_windows**:缩略图照常飞入,但 + - 不安装 wlroots 的 pointer/keyboard/touch grab(否则会顶掉拖拽自己的 grab); + - 不锁 cursor,保留拖拽图标; + - 每帧按 cursor 更新 hover 高亮(复用现有的 105% 放大 + 亮度插值)。 + +2. **一个 wlcom 层的 `seat_pointer_grab`**:`cursor_feed_motion()` 会先询问它, + 返回 true 就吞掉事件。在这个 grab 里: + - 根据 cursor 位置找到 hover 的缩略图; + - 把光标坐标从缩略图矩形线性映射回窗口本地坐标: + `sx = (px - thumb.x) * view.w / thumb.w`,`sy` 同理; + - 目标变了就调 `wlr_seat_pointer_notify_enter(seat, view->surface, sx, sy)`, + 否则调 `wlr_seat_pointer_notify_motion(seat, time, sx, sy)`; + - 这样目标 App 会像普通 DnD 一样收到 `enter/motion`,并在光标位置判断 + 「这里是不是一个可接收的输入框」,回 `accept`。 + - 松手时调 `wlr_seat_pointer_notify_button(..., RELEASED)` 后返回 true: + `wlr_drag` 的 `drag_handle_pointer_button` 看到 `focus_client && accepted`, + 就向真实窗口发 `drop` —— **原生 drop 完成**。 + - 同时调用 `selection_handle_cursor_move()` 让拖拽图标继续跟随。 + +3. **状态收尾**: + - 关闭 present_windows(反向动画); + - 恢复窗口状态(portal 不移动真实窗口,只隐藏缩略图,所以恢复很轻); + - 激活目标窗口,让用户看到粘贴结果; + - `cursor_rebase()` 恢复指针焦点。 + +关键前提(已核对代码): +- present_windows 用 `ky_scene_node_set_enabled(false)` 隐藏真实 view 的 scene node, + **surface 仍然是 mapped 的**,client 并不知道自己不可见,收 drop 完全正常。 +- `drag_set_focus()` 会为目标 client 创建 offer 并发送 `enter`; + client 的 `accept` 在 hover 期间就完成,松手时不存在时序竞争。 +- `drag_handle_pointer_button` 在 `focus_client && accepted` 时才会真正 drop, + 否则 drag 自然取消——目标不接受时不会误操作。 + +### 4.4 合成器改动(flake-wm + gxde-wlcom) + +两个仓库同源(flake-wm 用 CMake,gxde-wlcom 用 meson),代码相同、构建文件不同。 + +| 文件 | 改动 | +| --- | --- | +| `src/vendor/dkwin/presentwindows/wlcom_presentwindows.c` | 增加 portal 模式:不装 grab、不锁 cursor、每帧高亮;导出 `present_windows_begin_portal()` / `end_portal()` / `portal_item_rect()` / `portal_hovered_uuid()` | +| `src/vendor/gxde/portal/portal.c` | 新模块:D-Bus、状态机、grab、坐标映射、收尾 | +| `src/vendor/gxde/portal/portal_dbus.c` | `org.gxde.Portal` 接口 | +| `src/input/selection.c` | 暴露当前 drag 指针(或 portal 模块直接监听 seat 的 start_drag/destroy) | +| `src/view/view_p.h` | 导出 portal 需要的 present_windows 函数 | +| `CMakeLists.txt` / `meson.build` | 加 `src/vendor/gxde/portal` 目录 | + +D-Bus 接口草案(会话总线,合成器持有): + +``` +interface org.gxde.Portal + BeginPortal() -> b # 打开 portal;没有可平铺窗口返回 false + CancelPortal() + ListWindows() -> a(ssiiii) # uuid, title, app_id, x, y, w, h(调试 / 降级用) + signal DragStarted(ay mimes, s source_app_id) + signal DragEnded() + signal PortalDropped(s uuid, b accepted) +``` + +### 4.5 边界与异常 + +| 情况 | 行为 | +| --- | --- | +| 没有已打开窗口 | `BeginPortal()` 返回 false,面板提示「当前无已打开的窗口」,拖拽不中断 | +| 目标窗口不接受 drop | `accept` 为 false,drag 自然取消,面板提示「该窗口不接受拖放」 | +| 拖到缩略图之间的空隙 | 无目标,drag 取消 | +| 拖回面板/暂存区 | 按正常 drop 处理(暂存区接住) | +| 按 Esc | drag 取消,portal 关闭 | +| 目标窗口是拖拽源自己 | 允许(等同拖回原窗口) | +| 最小化/全屏窗口 | v1 只平铺当前工作区可见窗口;全屏窗口先退出全屏再平铺,结束后恢复 | +| 多显示器 | v1 在面板所在输出上平铺;后续支持跨屏 | +| 触摸拖拽 | v1 只做鼠标,触摸后续补 | + +### 4.6 降级:X11 / 非 GXDE 合成器 + +面板在传送门旁边扩展一块**窗口图标网格**(按空间自动选左/右/上/下): + +- 图标来源:Wayland 走 `org.gxde.Portal.ListWindows`,X11 走 EWMH `_NET_CLIENT_LIST`。 +- hover 图标 → 最小化其他窗口,激活/提升该窗口;用户把内容拖到已显示的窗口上松开 + → X11 的 XDND 是真实 drop,直接生效。 +- 拖出传送门区域 → 恢复原窗口状态。 +- 完全不支持 portal 的 Wayland 合成器:退化为「复制到剪贴板 + 提示」。 +- Windows 后续复用同一套图标网格 + `SetForegroundWindow`。 + +### 4.7 数据流(谁拿到 drop 数据) + +传输全程由源 App 和目标 App 通过 Wayland DnD 完成,**小埃同学不碰数据**: +- 从别的 App 拖入:源 App → 目标 App 直连;暂存区只保存 URI/文本/图片副本。 +- 从暂存区拖出:小埃同学作为 source 提供 `text/uri-list` / `text/plain` / `image/png`; + 目标 App 收到 drop。 + +因此传送门不需要读取别人的 data source,也不需要剪贴板,隐私面最小。 + +--- + +## 5. 暂存区 + +### 5.1 条目 + +| 类型 | 存储 | 说明 | +| --- | --- | --- | +| 文件 | URI | 保留原路径,可拖出到文件管理器/编辑器 | +| 文字 | 原文 | 展示做截断,完整保留 | +| 图片 | 缓存 PNG | 落盘到 `~/.cache/gxde-ai-see/images/`,不依赖源文件 | + +### 5.2 行为 + +- 只有**主动松手在暂存区**才添加;路过不算。不监听剪贴板。 +- 去重:同类型同内容(路径 / 文本 hash / 图片 hash)只留一条,重复拖入置顶并高亮。 +- 上限:默认 200 条,超出丢最旧,可配置。 +- 文件消失:`QFileSystemWatcher` + 2s 轮询双保险,消失则播放删除动画并移除。 +- 持久化:`~/.local/share/gxde-ai-see/staging.json`,原子写(QSaveFile)。 +- 暂存区非空 → 面板常显;为空 → 只在拖拽时出现。 +- 从暂存区跃迁后条目保留(除非用户删除或文件消失)。 + +### 5.3 列表交互 + +- 每行:复选框、缩略图/类型图标、名称、关闭按钮。 +- 选中任意复选框 → 列表上方出现「全选 / 反选 / 删除选中」;取消全不选后收起。 +- 拖动行排序(带动画),拖出到别的 App(`QDrag`),拖到传送门(原生 drop)。 + +--- + +## 6. 面板 UI 与动画 + +### 6.1 窗口形态 + +- Wayland:`layer-shell` Overlay 层,锚定右下,`keyboard_interactivity = none`, + 不抢焦点、不进 dock、可精确定位。 +- X11:无边框工具窗口 + `_NET_WM_STATE_SKIP_TASKBAR` + 右下定位。 +- 尺寸:宽 500;高度随内容,列表上限 `屏高 / 3`,超出滚动;顶部手柄可拖高; + 可「固定大小」。 +- 位置:默认右下(输入法面板附近),可拖边框移动,可恢复默认,可固定。 + +### 6.2 弹窗时机与「打扰」控制 + +拖拽在很多场景都会发生,无脑弹窗会很烦。控制策略: + +- **MIME 过滤**:只对 `text/uri-list`、`text/plain`、`image/*` 响应; + 拖窗口、拖滚动条、拖 Dock 图标这类没有这些 MIME 的不会触发。 +- **120ms 延迟**:拖拽开始后延迟再显示,快速点击式拖拽不闪面板。 +- **忽略自身拖拽**:从暂存区拖出时不重复弹面板。 +- **不抢焦点**:layer-shell + `keyboard none`,不会打断正在编辑的窗口。 +- **不遮挡**:面板固定在右下角,尺寸克制;可配置「仅暂存区非空时常显」。 +- **可关闭自动弹出**:设置里可关闭「拖拽时自动出现」,只保留常驻面板。 +- **悬停延迟**:传送门需要悬停约 150ms 才展开,路过不会炸开全屏。 +- **多显示器**:只在光标所在输出弹出,不在所有屏幕同时出现。 + +### 6.3 动画 + +| 场景 | 参考 | 效果 | +| --- | --- | --- | +| 面板出现/消失 | qimpanel | 上移 12px + 淡入,160ms OutCubic | +| 行 hover | desktop-panel hover box | 背景淡入 + 图标 1.04 + 关闭按钮淡入,120ms | +| 删除 | control-center `NotifyModel::showRemoveAnim` | 右移淡出 160ms,再折叠 + 后续行上移 180ms | +| 拖动排序 | desktop-panel dodge | 其余行 150ms 平移到新槽位,InOutCubic | +| 内容工厂展开 | — | 高度展开 + 图标错峰淡入 180ms | +| 传送门悬停 | — | 呼吸光晕 + 边框高亮 | +| 爆炸平铺 | present_windows | OutQuint 300ms,缩略图从真实位置飞入 | +| 复选框 | — | 勾选描边 120ms | + +### 6.4 右键菜单 + +固定位置 / 恢复默认位置 / 固定大小 / 恢复默认大小 / 置顶 / +全屏时隐藏 / 拖拽时自动出现 / 开机自启与保活 / 清空暂存区 / 设置 / 关于。 + +> 「置顶」的现实取舍见 §13 待确认 1。 + +--- + +## 7. 内容工厂 + +拖动时若类型受支持,面板下方出现「🔧 内容工厂」框;把内容拖到框上,框朝**有空间的 +方向**(左/右/上/下)展开动作面板;每个动作 hover 有缩放/光晕动画;松手在哪项执行哪项。 + +### 7.1 动作矩阵 + +| 类型 | 动作 | +| --- | --- | +| 文本 / 文本类 Office | 打开、**分词**、**提取链接**、翻译成…、朗读、添加到待办、问问小埃、复制 | +| 图片 | 打开、去除背景(占位)、OCR、添加到待办、问问小埃、**提取主色**、**生成描述** | +| 音频 | 打开、人声提取(占位)、添加到待办、问问小埃、**转文字**、**时长/码率信息** | +| 其他 | 打开、添加到待办、问问小埃、复制路径 | + +### 7.2 能力来源 + +- **分词**:ICU `BreakIterator`(zh)先做;效果不够再换内置词典。 +- **提取链接**:正则抽 `http(s)://`、`www.`、邮箱;弹框列出、单条/全部复制。 +- **打开**:`QDesktopServices::openUrl`。 +- **翻译 / 生成描述**:走小埃同学的模型(设置里选模型)。 +- **朗读**:优先 GXDE Daemon TTS,回退 `spd-say`。 +- **OCR**:优先 GXDE Daemon,未安装则禁用并提示。 +- **待办**:§8。 +- **问问小埃**:把内容作为附件塞进当前(或新建)对话的输入框。 + +--- + +## 8. 待办 + +- 独立小窗口:可选置顶、可拖动、不进任务栏、位置大小持久化。 +- 列表项:复选框、文本、删除;支持拖动排序。 +- 数据存 `~/.local/share/gxde-ai-see/todo.json`。 +- 入口:面板右键菜单、内容工厂「添加到待办」、桌面文件。 + +--- + +## 9. 小埃同学 Chat + +### 9.1 初版范围 + +- **API**:DeepSeek 官方预设 + 自定义 `base_url / model / key`; + 首次启动引导开通 DeepSeek 并填 Key(可跳过,稍后在设置里填)。 +- **对话**:多对话管理(新建/重命名/删除/置顶)、流式输出、Markdown 渲染、 + 代码块高亮/复制。 +- **编辑**:修改用户消息、重试上一条、从任意消息 fork 新对话。 +- **上下文**:token 估算;手动压缩;超阈值自动压缩(让模型总结旧消息); + 可设上下文长度。 +- **MCP**:stdio server 配置、`tools/list`、`tools/call`,以 function calling 暴露给模型。 +- **设置**:模型参数、系统提示、代理、MCP、数据目录、关于。 +- **独立入口**:`gxde-ai-see.desktop`,图标由 `Pictures/同步区/erotica/image_7.png` + 处理成多尺寸 hicolor 图标。 +- **关于**:版本、许可、仓库、致谢。 + +### 9.2 技术 + +- Qt6 Widgets + DTK2;HTTP 用 `QNetworkAccessManager`(SSE 流式);SQLite 存对话。 +- MCP 用 `QProcess` + JSON-RPC 2.0(stdio),协议与 DSH 对齐。 +- UI 参考 DSH Web:左侧会话栏、消息流、底部输入框、设置。 +- 后续:skill、DSH 定制发行、让聊天修改自身配置(安装 skill 等)。 + +--- + +## 10. 后台与 gxde-k9 + +- 安装 `~/.local/share/GXDE/gxde-k9/slimy/gxde-ai-see.slimy`, + 由 k9 每 5s 做 PID 检测并拉起 `gxde-ai-see --daemon`。 +- 设置项「开机自启动与后台保活」= 创建/删除该 `.slimy` 文件。 +- **环境不支持**(没有 `org.gxde.Portal`、X11 且无降级后端等): + - 首次弹一次 toast(dconf/配置记 `warned-unsupported`); + - 进程**不退出**,进入低资源空闲(不轮询、不建窗口),避免 k9 反复拉起。 + +--- + +## 11. 工程结构 + +``` +gxde-ai-see/ +├── CMakeLists.txt +├── src/ +│ ├── main.cpp +│ ├── app.{h,cpp} # 单实例、生命周期、后台模式 +│ ├── config.{h,cpp} # 配置 +│ ├── staging/ # 暂存区模型/存储/缩略图 +│ ├── ui/ # 面板、列表、委托、内容工厂、待办、聊天 +│ ├── portal/ # org.gxde.Portal 客户端 + 降级后端 +│ ├── chat/ # DeepSeek 客户端、MCP、会话存储 +│ └── actions/ # 分词、链接提取、TTS、OCR 适配 +├── data/ # desktop、图标、gschema +├── debian/ +├── docs/PLAN.md +└── README.md +``` + +合成器侧:`flake-wm` 和 `gxde-wlcom` 各加 `src/vendor/gxde/portal/`。 + +--- + +## 12. 里程碑 + +| 阶段 | 内容 | 可验证 | +| --- | --- | --- | +| **M0** | 技术验证:portal grab + 重定向 drop + present_windows portal 模式 | 嵌套合成器里拖一个文件进编辑器输入框 | +| **M1** | App 骨架:构建/单实例/配置/面板/暂存区/持久化/动画 | 当前会话可用的暂存区 | +| **M2** | 合成器 portal 模块(两个仓库)+ 原生 drop 全流程 | 传送门端到端 | +| **M3** | 内容工厂(本地动作 + AI 动作)+ 待办 | 分词/提链接/翻译/待办 | +| **M4** | 小埃同学 Chat(API/流式/多对话/编辑/重试/fork/上下文) | 可日常对话 | +| **M5** | MCP、自动压缩、skill 预留 | 接 MCP server | +| **M6** | 打包、k9、i18n、关于、图标、文档 | deb 可安装 | + +--- + +## 13. 待确认 + +1. **「置顶」的语义**:v1 面板用 layer-shell,天然不抢焦点、不进 dock、位置精确, + 但 layer-shell 无法做到「被普通窗口盖住」。可选: + - A(推荐 v1):layer-shell;「取消置顶」= 被窗口遮挡时自动隐藏; + - B:普通窗口 + 合成器窗口 hints(真正的 kept_above 开关,改动更大); + - C:layer-shell + 合成器扩展「普通层」。 +2. **传送门原生 drop 方案**(§4.3)是否认可?这是整个方案的地基。 +3. **内容工厂**的动作集合与「朝有空间方向展开」的交互是否 OK? +4. **Chat 初版范围**(§9.1)是否合适?MCP / 压缩是否要放进初版? +5. **分词**先用 ICU 是否可接受? +6. **合成器落地顺序**:先 flake-wm 再移植 gxde-wlcom,还是两个仓库同步改? + +--- + +## 14. 风险 + +| 风险 | 影响 | 对策 | +| --- | --- | --- | +| client 对不可见 surface 忽略 DnD | portal 失效 | M0 先验证;不行则降级为「激活窗口 + 粘贴」 | +| 坐标映射误差(缩放/分数缩放) | drop 落点偏 | 用 item 实际 rect 与 view geometry 计算,加 clamp | +| 合成器 grab 与拖拽 grab 冲突 | 拖拽中断 | portal 模式不装 wlroots grab,只用 wlcom 层 grab | +| 目标 App 不支持 DnD | 没反应 | 提示「该窗口不接受拖放」 | +| 大图/大文本 | 内存 | 图片落盘、文本截断展示、上限 200 | +| k9 反复拉起 | 资源浪费 | 不支持环境不退出,低资源空闲 | +| X11 行为差异 | 降级 | 图标网格 + EWMH | + +--- + +## 15. 参考 + +- `flake-wm` / `gxde-wlcom`:`src/vendor/dkwin/presentwindows/`、 + `src/input/selection.c`、`src/input/cursor.c`、`src/view/view_p.h` +- `gxde-file-manager/gxde-desktop-panel`:hover / dodge 动画 +- `gxde-control-center/src/frame/notify`:删除动画 +- `dtk2widget-qt6`:DBlurEffectWidget / DApplication +- `gxde-k9`:保活 +- DSH(`deepseek-harness`):对话界面与 MCP 参考