diff --git a/.codex-synaptic/instructions.db b/.codex-synaptic/instructions.db index 4c646f6..fe1399b 100644 Binary files a/.codex-synaptic/instructions.db and b/.codex-synaptic/instructions.db differ diff --git a/.codex-synaptic/memory.db b/.codex-synaptic/memory.db new file mode 100644 index 0000000..8308945 Binary files /dev/null and b/.codex-synaptic/memory.db differ diff --git a/LICENSE b/LICENSE index 6aece5b..be3f7b2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,661 @@ -MIT License - -Copyright (c) 2025 Parallax Analytics - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 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 Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are 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. + + 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. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + 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 Affero 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. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + 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 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 work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero 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 Affero 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 Affero 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 Affero 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. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + 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 AGPL, see +. diff --git a/README.md b/README.md index 4c32c11..4190d1d 100644 --- a/README.md +++ b/README.md @@ -1,173 +1,150 @@ # codex-synaptic -Distributed agent orchestration for coding workflows: mesh + swarm + consensus + Codex passthrough. - -## Current Status (2026-02-11) - -- Release track: **Codex macOS 2026 readiness** (from beta-hardening toward internal release). -- Package version: **`1.0.0`** (source of truth is `package.json`). -- Readiness baseline before this rekick: ~60% (consensus quorum reliability, autoscaler scale-down behavior, and packaging hygiene were blocking). -- OpenAI ecosystem alignment target: - - Codex app for macOS launched **2026-02-02**. - - GPT-5.3-Codex launched **2026-02-05**. - - `codex-mini-latest` removed from API access on **2026-01-16**. - -## What Changed in This Rekick - -- Added a formal roadmap + gap report: [`docs/roadmaps/codex-macos-2026-rekick.md`](docs/roadmaps/codex-macos-2026-rekick.md) -- Modernized model/runtime defaults to Codex-family-first routing for coding workflows. -- Added macOS workflow documentation for Local / Worktree / Cloud operation modes. -- Hardened consensus quorum behavior and autoscaler scale-down fallback handling. -- Added release preflight command for packaging/remote hygiene. -- Archived 2025 roadmap/planning docs explicitly to remove active-roadmap ambiguity. +[![Stars](https://img.shields.io/github/stars/clduab11/codex-synaptic?style=for-the-badge&logo=github)](https://github.com/clduab11/codex-synaptic/stargazers) +[![Forks](https://img.shields.io/github/forks/clduab11/codex-synaptic?style=for-the-badge&logo=github)](https://github.com/clduab11/codex-synaptic/network/members) +[![Open Issues](https://img.shields.io/github/issues/clduab11/codex-synaptic?style=for-the-badge&logo=github)](https://github.com/clduab11/codex-synaptic/issues) +[![Open PRs](https://img.shields.io/github/issues-pr/clduab11/codex-synaptic?style=for-the-badge&logo=github)](https://github.com/clduab11/codex-synaptic/pulls) +[![Commit Activity](https://img.shields.io/github/commit-activity/m/clduab11/codex-synaptic?style=for-the-badge&logo=git)](https://github.com/clduab11/codex-synaptic/commits/main) +[![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue?style=for-the-badge)](https://www.gnu.org/licenses/agpl-3.0.en.html) +[![Node](https://img.shields.io/badge/Node-20%2B-339933?style=for-the-badge&logo=node.js)](https://nodejs.org/) +[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?style=for-the-badge&logo=typescript)](https://www.typescriptlang.org/) + +Operator-grade orchestration for Codex workflows: daemon-backed runtime control, live terminal dashboards, and MCP-driven external bridges. + +## Why This Release + +Codex for macOS is now the default frontend path for this repo's operator workflow. This release tightens the "app + CLI + MCP" loop so teams can run Codex-Synaptic predictably in Local, Worktree, and Cloud-aligned flows. + +### Verified alignment with official OpenAI docs (February 2026) + +- Codex app setup is macOS (Apple Silicon) and recommended for Mac users. +- App feature model includes Local / Worktree / Cloud modes, built-in Git, integrated terminal, automations, and MCP support. +- Codex CLI supports interactive mode, `resume`, `cloud`, `exec`, and `mcp` operations. +- Security defaults recommend workspace-write + on-request approvals for version-controlled repos. + +Sources: +- [Codex Quickstart](https://developers.openai.com/codex/quickstart/) +- [Codex App](https://developers.openai.com/codex/app/) +- [Codex App Features](https://developers.openai.com/codex/app/features/) +- [Codex CLI Features](https://developers.openai.com/codex/cli/features/) +- [Codex Security](https://developers.openai.com/codex/security/) + +## Star Chart + +[![Star History Chart](https://api.star-history.com/svg?repos=clduab11/codex-synaptic&type=Date)](https://star-history.com/#clduab11/codex-synaptic&Date) + +## System Flow + +```mermaid +flowchart LR + A["Codex App (macOS)"] -->|"Local / Worktree / Cloud"| B["codex-synaptic CLI"] + B --> C["Runtime Authority Guard"] + C --> D["Detached Daemon"] + C --> E["Local Session"] + D --> F["Dashboard / TUI Attach"] + E --> F + B --> G["MCP Profiles"] + G --> G1["mcp-filesystem"] + G --> G2["mcp-playwright"] + G --> G3["mcp-desktop-commander"] + B --> H["Bridge Layer"] + H --> I["External Swarm / MCP Endpoints"] +``` -## Quick Start +## Operator Command Deck ```bash -# install + build +# build npm install npm run build -# verify CLI health from a cold shell -npm run cli -- system status +# readiness +node dist/cli/index.js doctor +node dist/cli/index.js doctor --strict -# run a one-shot startup smoke -npm run cli -- system start - -# run release gates -npm run lint -npm test -npm run release:preflight +# daemon lifecycle +node dist/cli/index.js background start +node dist/cli/index.js background status +node dist/cli/index.js background attach --watch --interval 2000 +node dist/cli/index.js background logs --tail 100 +node dist/cli/index.js background restart --timeout 10000 +node dist/cli/index.js background stop --timeout 10000 + +# live dashboard +node dist/cli/index.js tui --attach-daemon --interval 1000 +node dist/cli/index.js tui --local --interval 1000 + +# MCP profiles and registration +node dist/cli/index.js env plan mcp-filesystem mcp-playwright mcp-desktop-commander +node dist/cli/index.js env up mcp-filesystem mcp-playwright mcp-desktop-commander +node dist/cli/index.js env status mcp-filesystem mcp-playwright mcp-desktop-commander +node dist/cli/index.js env codex-register mcp-filesystem mcp-playwright mcp-desktop-commander --replace ``` Non-interactive CLI commands run in one-shot mode by default (the process exits after command completion). Set `CODEX_CLI_AUTO_SHUTDOWN=0` only when you explicitly want to keep the in-process foreground session alive for debugging. -## Model + Runtime Guidance (Codex-Focused) - -Use **Responses API** for agentic coding flows. - -| Purpose | Recommended model | Fallback | Deprecation-safe fallback | -| --- | --- | --- | --- | -| Primary coding orchestration | `gpt-5.3-codex` | `gpt-5-codex` | `gpt-5` | -| Validation / review | `gpt-5-codex` | `gpt-5-mini` | `gpt-5-nano` | -| High-complexity governance paths | `gpt-5-pro` | `gpt-5-codex` | `gpt-5` | - -Notes: - -- Codex-focused models should not use `codex-mini-latest` (removed 2026-01-16). -- Codex-family models are treated as Responses-first in this repo. -- Chat Completions remains supported in the ecosystem, but this project prefers Responses for reasoning/tool flows. - -## Codex macOS Workflows - -Full guide: [`docs/guides/codex-macos-workflows.md`](docs/guides/codex-macos-workflows.md) - -### Local mode +## Codex for macOS Workflow ```bash +# Local mode codex -C /absolute/path/to/codex-synaptic -``` -### Worktree mode +# Worktree mode +git worktree add ../codex-synaptic-worktree -b codex/macos-ops +codex -C ../codex-synaptic-worktree -```bash -git worktree add ../codex-synaptic-macos-2026 -b codex/macos-2026-readiness -codex -C ../codex-synaptic-macos-2026 +# cloud task operations from CLI +codex cloud --help ``` -### Cloud mode - -```bash -codex cloud list --json -codex cloud exec --env "Run codex-synaptic readiness fixes" -codex cloud status -codex cloud apply +```mermaid +flowchart LR + L["Local Mode"] --> V["Fast Iteration"] + W["Worktree Mode"] --> S["Parallel, Isolated Changes"] + C["Cloud Mode"] --> R["Remote Task Delegation"] + V --> O["Unified Review + Merge"] + S --> O + R --> O ``` -### Skills, automations, and MCP - -- Skills/automation safety guidance and operating rules are documented in [`docs/guides/codex-macos-workflows.md`](docs/guides/codex-macos-workflows.md). -- MCP catalog and setup commands are documented in [`docs/mcp/README.md`](docs/mcp/README.md). - -## Stability Blockers: Status + Mitigation +## MCP Profiles Included -| Blocker | Status | Mitigation in repo | +| Profile | Purpose | Safety posture | | --- | --- | --- | -| Consensus quorum gating reliability | Mitigated | Quorum requirements clamp to feasible voter population; finalization now uses eligible voters, not total agents. | -| Autoscaler scale-down when daemon inactive | Mitigated (guarded fallback) | Deferred reduction telemetry + non-daemon informative logging instead of opaque failure warnings. | -| Packaging/release hygiene + remote alignment | Mitigated | `npm run release:preflight` checks directory name, origin remote, working tree cleanliness (excluding configurable ephemeral runtime artifacts), and `npm pack --dry-run`. | +| `mcp-filesystem` | Repo/document access for Codex tasks | defaults to safe mode; controlled write can be explicitly enabled | +| `mcp-playwright` | Browser automation and verification | command-scoped runtime with health checks | +| `mcp-desktop-commander` | Desktop-level command bridge for external orchestration workflows | explicit profile startup + diagnostics before use | -### Release Preflight Ephemeral Allowlist +## February 2026 Prompting Baseline -`npm run release:preflight` ignores a default set of local runtime SQLite artifacts and supports additional ephemeral paths via env/config: +Use this structure for high-signal Codex tasks in this repo: -- Environment: `CODEX_RELEASE_PREFLIGHT_EPHEMERAL_ALLOWLIST` as a comma/newline/semicolon-delimited list. -- Config: `releasePreflight.ephemeralAllowlist` array in `config/system.json` (or alternate config path via `CODEX_RELEASE_PREFLIGHT_CONFIG`). +1. Mission: one objective. +2. Constraints: boundaries, safety controls, non-goals. +3. Acceptance criteria: objective pass/fail list. +4. Verification: exact commands and expected outcomes. +5. Deliverables: changed files, test evidence, residual risks. -Example: +## Security Posture (Codex-aligned) + +Recommended defaults for version-controlled repos: ```bash -CODEX_RELEASE_PREFLIGHT_EPHEMERAL_ALLOWLIST=".codex-synaptic/runtime.pid,tmp/runtime.lock" npm run release:preflight +codex --sandbox workspace-write --ask-for-approval on-request ``` -## Release Readiness Checklist - -A release is considered internally ready only when all gates pass: - -- [ ] `npm run lint` exits `0`. -- [ ] `npm test` exits `0`. -- [ ] Representative CLI smoke flow succeeds (`npm run cli -- system start`, `npm run cli -- reasoning plan "Stabilize codex-synaptic release readiness" --require-consensus --json`, `npm run cli -- openai usage --json`, `npm run cli -- hive-mind spawn "Verify macOS readiness smoke flow" --codex --dry-run`). -- [ ] `npm run release:preflight` exits `0`. -- [ ] README, roadmap, and changelog dates are current and consistent with package version. -- [ ] No active roadmap section references 2025 phases without an explicit archival note. - -## Roadmap - -### 2026 active roadmap - -1. Stabilize consensus/autoscaler/release hygiene paths for internal release. -2. Expand Codex macOS worktree/cloud contributor workflows and verification automation. -3. Harden MCP integration profiles and observability signals for daily operations. - -### 2025 roadmap archival note - -The previous 2025 phase plans are retained as historical artifacts and now explicitly marked archived: - -- [`docs/integration/OPENAI_PLATFORM_2025_INTEGRATION.md`](docs/integration/OPENAI_PLATFORM_2025_INTEGRATION.md) -- [`docs/plans/sprint-2-implementation-plan.md`](docs/plans/sprint-2-implementation-plan.md) -- [`docs/plans/week-3-backlog.md`](docs/plans/week-3-backlog.md) - -## Core Commands +Use stricter read-only mode when auditing unfamiliar code: ```bash -# system -node dist/cli/index.js system start -node dist/cli/index.js system status -node dist/cli/index.js background start -node dist/cli/index.js background status - -# consensus -node dist/cli/index.js consensus status -node dist/cli/index.js consensus telemetry --limit 5 - -# openai usage -node dist/cli/index.js openai usage --json - -# codex passthrough -codex-synaptic --codex --dry-run "Inspect release readiness drift" +codex --sandbox read-only --ask-for-approval on-request ``` -## Documentation Index +## Docs Index -- Docs home: [`docs/README.md`](docs/README.md) -- Quick start: [`docs/guides/quick-start.md`](docs/guides/quick-start.md) -- macOS modes and workflows: [`docs/guides/codex-macos-workflows.md`](docs/guides/codex-macos-workflows.md) -- MCP setup: [`docs/mcp/README.md`](docs/mcp/README.md) -- Rekick roadmap: [`docs/roadmaps/codex-macos-2026-rekick.md`](docs/roadmaps/codex-macos-2026-rekick.md) +- [macOS integration workflow](docs/guides/codex-macos-workflows.md) +- [MCP setup and profile catalog](docs/mcp/README.md) +- [Autoscaler/daemon runbook](docs/runbooks/autoscaler-daemon-coordination.md) -## Contributing +## License -1. Create a branch (prefix `codex/` recommended for feature work). -2. Keep changes small and testable. -3. Run: `npm run lint && npm test && npm run release:preflight`. -4. Open a PR with blockers/risks called out explicitly. +This project is licensed under **GNU Affero General Public License v3.0 (AGPL-3.0)**. See [LICENSE](LICENSE). diff --git a/docker/mcp/docker-compose.desktop-commander.yml b/docker/mcp/docker-compose.desktop-commander.yml new file mode 100644 index 0000000..d119426 --- /dev/null +++ b/docker/mcp/docker-compose.desktop-commander.yml @@ -0,0 +1,9 @@ +version: '3.8' +services: + mcp-desktop-commander: + image: ghcr.io/wonderwhy-er/desktop-commander:latest + container_name: codex-mcp-desktop-commander + restart: unless-stopped + ports: + - "7070:7070" + command: ["--port", "7070"] diff --git a/docker/mcp/docker-compose.filesystem.yml b/docker/mcp/docker-compose.filesystem.yml index a278318..b94b27b 100644 --- a/docker/mcp/docker-compose.filesystem.yml +++ b/docker/mcp/docker-compose.filesystem.yml @@ -5,7 +5,7 @@ services: container_name: codex-mcp-filesystem restart: unless-stopped volumes: - - ../../:/workspace:ro + - ../../:/workspace:${MCP_FILESYSTEM_MOUNT_MODE:-ro} ports: - "7040:7040" command: ["--port", "7040", "--root", "/workspace"] diff --git a/docs/guides/codex-macos-workflows.md b/docs/guides/codex-macos-workflows.md index 90b58a2..527a2d4 100644 --- a/docs/guides/codex-macos-workflows.md +++ b/docs/guides/codex-macos-workflows.md @@ -1,80 +1,120 @@ -# Codex macOS Workflows (Local, Worktree, Cloud) +# Codex macOS Workflows (Local, Worktree, Cloud + MCP) -Last reviewed: 2026-02-10 -Audience: contributors using macOS (Apple Silicon) with Codex app/CLI and Codex-Synaptic. +Last reviewed: 2026-02-13 +Audience: contributors using Codex app/CLI on macOS (Apple Silicon) with Codex-Synaptic. -## Prerequisites +## Source Of Truth -```bash -# Codex CLI -codex --version +This guide is aligned with: + +- `codex --help` +- `codex mcp --help` +- `codex mcp add --help` +- OpenAI Codex docs: + - `https://developers.openai.com/codex/quickstart/` + - `https://developers.openai.com/codex/app/` + - `https://developers.openai.com/codex/app/features/` + - `https://developers.openai.com/codex/cli/features/` + - `https://developers.openai.com/codex/security/` + +## Bootstrap And Doctor (Run First) -# Codex-Synaptic project deps +```bash +cd /absolute/path/to/codex-synaptic npm install npm run build -``` -Expected output indicators: +# verify codex + mcp command surfaces +codex --help +codex mcp --help +codex mcp add --help + +# one-shot readiness checks (auth + mcp + repo cli) +node dist/cli/index.js doctor -```text -codex-cli -.../dist/cli/index.js generated +# enforce failure in CI/automation +node dist/cli/index.js doctor --strict --json ``` -## Local Mode (fastest inner loop) +## Runtime Model (Deterministic) -Use this when editing directly in your current repository checkout. +Use one orchestrator authority at a time: + +- Detached authority: `background start` + attach/monitor/TUI against daemon. +- In-process authority: `system start` + `system monitor` in current shell. + +If a daemon is already running, local `system start` is blocked to prevent split-brain (unless explicitly overridden with `CODEX_ALLOW_LOCAL_WITH_DAEMON=1`). + +### Daemon-Centric Operations ```bash -codex -C /absolute/path/to/codex-synaptic -# or non-interactive: -codex exec -C /absolute/path/to/codex-synaptic "Audit consensus gating and suggest minimal fixes" +node dist/cli/index.js background start +node dist/cli/index.js background status +node dist/cli/index.js background attach --watch --interval 2000 +node dist/cli/index.js background logs --tail 100 +node dist/cli/index.js background restart +node dist/cli/index.js background stop --timeout 10000 ``` -Recommended project checks: +### Local Session Operations ```bash -npm run lint -npm test +node dist/cli/index.js system start node dist/cli/index.js system status +node dist/cli/index.js system monitor --interval 2000 +node dist/cli/index.js system stop ``` -Expected output indicators: +### Terminal Dashboard (TUI) -```text -PASS/FAIL from eslint and vitest -System not started. Run `codex-synaptic system start` first. -or a full status snapshot when already running. +```bash +# attach to daemon (preferred when detached runtime is active) +node dist/cli/index.js tui --attach-daemon --interval 1000 + +# force local dashboard +node dist/cli/index.js tui --local --interval 1000 ``` -## Worktree Mode (parallel-safe development) +## Codex App Modes + +OpenAI Codex app modes: -Use this for isolated tracks and reviewable diffs. +- `Local`: edits current project directory. +- `Worktree`: isolates changes in a dedicated git worktree. +- `Cloud`: remote execution in configured cloud environment. + +Reference: `https://developers.openai.com/codex/app/features/`. + +## Local Mode (Fastest Inner Loop) ```bash -# create feature worktree -git worktree add ../codex-synaptic-macos-2026 -b codex/macos-2026-readiness +codex -C /absolute/path/to/codex-synaptic +# non-interactive: +codex exec -C /absolute/path/to/codex-synaptic "Audit consensus gating and suggest minimal fixes" +``` -# open codex in new worktree -codex -C ../codex-synaptic-macos-2026 +Recommended checks: + +```bash +npm run lint +npm test +node dist/cli/index.js system status ``` -Expected output indicators: +## Worktree Mode (Parallel-Safe) -```text -Preparing worktree (new branch 'codex/macos-2026-readiness') -HEAD is now at ... +```bash +git worktree add ../codex-synaptic-macos-2026 -b codex/macos-2026-readiness +codex -C ../codex-synaptic-macos-2026 ``` -Cleanup when merged: +Cleanup: ```bash git worktree remove ../codex-synaptic-macos-2026 ``` -## Cloud Mode (remote execution) - -Use this when tasks should run remotely and apply back locally. +## Cloud Mode (Remote Execution) ```bash codex cloud list --json @@ -84,66 +124,57 @@ codex cloud diff codex cloud apply ``` -Expected output indicators: +## MCP Setup (Filesystem + Playwright + Desktop Commander) -```text -TASK_ID ... -status: queued|running|succeeded|failed -Applied diff for task ... -``` - -## Skills and Automations: Safe Usage Rules +```bash +# inspect profiles and codex registration targets +node dist/cli/index.js env plan mcp-filesystem mcp-playwright mcp-desktop-commander -1. Prefer worktree mode for broad/refactor tasks. -2. Keep prompts single-purpose; avoid packing unrelated asks into one run. -3. Require consensus for high-risk flows: +# safest default: filesystem read-only +node dist/cli/index.js env up mcp-filesystem mcp-playwright mcp-desktop-commander -```bash -node dist/cli/index.js reasoning plan "Production-impacting release update" --require-consensus -``` +# optional controlled-write filesystem mode (explicit opt-in required) +node dist/cli/index.js env up mcp-filesystem --filesystem-mode controlled-write --allow-filesystem-write -4. Validate automation outputs before apply/merge. -5. For recurring automations, include explicit gating in prompt text (for example: "skip if lint fails", "do not mutate release branches"). +# health/status diagnostics +node dist/cli/index.js env status mcp-filesystem mcp-playwright mcp-desktop-commander -## MCP Integration Setup (docs/tooling) +# register HTTP MCP servers with Codex CLI config +node dist/cli/index.js env codex-register mcp-filesystem mcp-playwright mcp-desktop-commander --replace +codex mcp list --json +``` -Codex-Synaptic exposes MCP service profiles via `env` commands. +Expected indicators: -```bash -# list profiles -node dist/cli/index.js env list +- `env status` returns `running: yes` and `healthy: yes` for active profiles. +- `doctor` reports MCP profile checks passing and registration present. -# bring up MCP services -node dist/cli/index.js env up mcp-filesystem -node dist/cli/index.js env up mcp-playwright +## Sandbox And Approval Recommendations -# check health -node dist/cli/index.js env status mcp-filesystem mcp-playwright +From Codex security guidance (`https://developers.openai.com/codex/security/`): -# inspect Codex CLI MCP registry -codex mcp list -``` +1. Default for trusted repo work: `workspace-write` + `on-request` approvals (Codex `--full-auto` behavior). +2. For unfamiliar/untrusted code: start in `read-only` mode. +3. Use danger-full-access only in explicitly isolated environments. -Expected output indicators: +Practical examples: -```text -mcp-filesystem ... running/healthy -mcp-playwright ... running/healthy - +```bash +codex --sandbox workspace-write --ask-for-approval on-request +codex --sandbox read-only --ask-for-approval on-request ``` ## Recommended Daily Loop ```bash -# 1) refresh build +# 1) refresh build + readiness npm run build +node dist/cli/index.js doctor --strict -# 2) run focused work (local or worktree) +# 2) run focused work codex exec "Implement one bounded fix with tests" -# 3) verify +# 3) verify before merge npm run lint && npm test - -# 4) release preflight before merge/release npm run release:preflight ``` diff --git a/docs/mcp/README.md b/docs/mcp/README.md index 8e4ddbf..626f011 100644 --- a/docs/mcp/README.md +++ b/docs/mcp/README.md @@ -1,64 +1,92 @@ # Codex-Synaptic MCP Service Catalog -Codex-Synaptic can lazily spin MCP servers whenever a workflow or tool needs them. Each service is described below, along with the Docker Compose fragment used by the environment manager (`codex-synaptic env ...`). +This catalog documents MCP profiles managed by `codex-synaptic env ...` and how to register them in Codex CLI/App. ## How It Works -1. When a workflow requests a tool supplied by an MCP server (e.g., GitHub PR fetch), Codex-Synaptic calls the environment manager to ensure the corresponding service is running. -2. The manager executes `docker compose -f docker/mcp/docker-compose..yml up -d`, waits for the service to become healthy (if a health probe is defined), then registers the MCP tools dynamically. -3. When work is done you may shut services down with `codex-synaptic env down `. +1. `env up ` starts profile compose stacks and waits for health checks by default. +2. `env status ` reports runtime + health diagnostics (including probe failures). +3. `env codex-register ` writes streamable HTTP MCP entries into Codex via `codex mcp add --url ...`. -All images listed below are free to run. You may substitute your own fork or custom build—just update the compose file and restart. +Profiles are defined in `src/env/service-manager.ts` and backed by compose files in `docker/mcp/`. ## Available MCP Profiles -| Profile | Compose File | Default Port | Env Vars | Notes | -|---------|--------------|--------------|---------|-------| -| `mcp-github` | `docker/mcp/docker-compose.github.yml` | 7010 | `GITHUB_TOKEN` | GitHub MCP for repository/issues/PR automation. Requires a PAT with appropriate scopes. | -| `mcp-context7` | `docker/mcp/docker-compose.context7.yml` | 7020 | `CONTEXT7_API_KEY` | Context7 high-level browser automation. | -| `mcp-playwright` | `docker/mcp/docker-compose.playwright.yml` | 7030 | — | Playwright MCP worker with Chromium automation. | -| `mcp-filesystem` | `docker/mcp/docker-compose.filesystem.yml` | 7040 | — | Read-only access to the workspace (mounts `../../`). Adjust the compose file if you need write access. | -| `mcp-tavily` | `docker/mcp/docker-compose.tavily.yml` | 7050 | `TAVILY_API_KEY` | Tavily search MCP for quick web lookups. | -| `mcp-firecrawl` | `docker/mcp/docker-compose.firecrawl.yml` | 7060 | `FIRECRAWL_API_KEY` | Firecrawl crawler MCP for deep web extraction. | +| Profile | Compose File | Default Port | Required Env | Codex MCP Name | Notes | +|---------|--------------|--------------|--------------|----------------|-------| +| `mcp-github` | `docker/mcp/docker-compose.github.yml` | 7010 | `GITHUB_TOKEN` | `github` | GitHub automation and PR tooling. | +| `mcp-context7` | `docker/mcp/docker-compose.context7.yml` | 7020 | `CONTEXT7_API_KEY` | `context7` | Context7 browser/service tooling. | +| `mcp-playwright` | `docker/mcp/docker-compose.playwright.yml` | 7030 | — | `playwright-local` | Browser automation profile. | +| `mcp-filesystem` | `docker/mcp/docker-compose.filesystem.yml` | 7040 | — | `filesystem-local` | Filesystem MCP, read-only by default. | +| `mcp-tavily` | `docker/mcp/docker-compose.tavily.yml` | 7050 | `TAVILY_API_KEY` | `tavily` | Web search MCP. | +| `mcp-firecrawl` | `docker/mcp/docker-compose.firecrawl.yml` | 7060 | `FIRECRAWL_API_KEY` | `firecrawl` | Crawl/extraction MCP. | +| `mcp-desktop-commander` | `docker/mcp/docker-compose.desktop-commander.yml` | 7070 | — | `desktop-commander` | Desktop/tooling automation MCP profile. | -> **Heads-up:** Image tags reference the public Context Labs/Firecrawl registries at the time of writing. Swap to your preferred tags or pin to specific digests in production. +## Filesystem Safety Modes + +`mcp-filesystem` supports explicit runtime modes: + +- `read-only` (default): container mount is read-only. +- `controlled-write`: requires explicit opt-in at command time. + +Examples: + +```bash +# default safe mode +node dist/cli/index.js env up mcp-filesystem + +# explicit controlled write mode +node dist/cli/index.js env up mcp-filesystem --filesystem-mode controlled-write --allow-filesystem-write +``` ## CLI Quick Reference ```bash -# List defined MCP/observability/vector profiles -codex-synaptic env list +# inspect profile metadata (ports, codex names, requirements) +node dist/cli/index.js env plan mcp-filesystem mcp-playwright mcp-desktop-commander -# Spin up GitHub MCP (waits for health by default) -codex-synaptic env up mcp-github +# start MCP profiles and wait for health +node dist/cli/index.js env up mcp-filesystem mcp-playwright mcp-desktop-commander -# Check status of multiple services -codex-synaptic env status mcp-github mcp-playwright +# check health + diagnostics +node dist/cli/index.js env status mcp-filesystem mcp-playwright mcp-desktop-commander -# Tear down when you are done -codex-synaptic env down mcp-github -``` +# register MCP HTTP endpoints in codex +node dist/cli/index.js env codex-register mcp-filesystem mcp-playwright mcp-desktop-commander --replace -Add or modify compose fragments under `docker/mcp/` and they will show up automatically in `codex-synaptic env list`. +# verify codex registry +codex mcp list --json +``` -## Codex CLI / App Integration +## Codex CLI/App Registration Notes -Codex-Synaptic MCP profiles can be used alongside Codex app/CLI workflows: +Verified `codex` CLI surface: ```bash -# Inspect configured MCP servers in Codex CLI -codex mcp list +codex mcp --help +codex mcp add --help +``` + +`codex mcp add` supports streamable HTTP registration with: + +- `--url ` +- optional `--bearer-token-env-var ` -# Add a server (example: local filesystem MCP) -codex mcp add filesystem -- node dist/mcp/codex-mcp-server.js +Codex app, CLI, and IDE extension share MCP configuration state; registration in one surface is visible in the others. -# Inspect one entry -codex mcp get filesystem +## Startup Diagnostics + +Use the doctor workflow for one-pass validation: + +```bash +node dist/cli/index.js doctor --strict ``` -Expected output indicators: +Doctor verifies: -- `codex mcp list` returns one or more registered MCP server labels. -- `env status ...` reports `running`/`healthy` for Docker-backed MCP services. +- Codex auth state (`codex login status`) +- `codex mcp list --json` availability +- MCP profile runtime health +- MCP registration presence for default profiles (`mcp-filesystem`, `mcp-playwright`, `mcp-desktop-commander`) -For macOS mode guidance (Local/Worktree/Cloud + automation guardrails), see [`docs/guides/codex-macos-workflows.md`](../guides/codex-macos-workflows.md). +For end-to-end macOS workflow guidance, see [`docs/guides/codex-macos-workflows.md`](../guides/codex-macos-workflows.md). diff --git a/docs/reports/runtime-architecture-delta-2026-02-13.md b/docs/reports/runtime-architecture-delta-2026-02-13.md new file mode 100644 index 0000000..c22c132 --- /dev/null +++ b/docs/reports/runtime-architecture-delta-2026-02-13.md @@ -0,0 +1,38 @@ +# Runtime Architecture Delta (2026-02-13) + +## Scope + +This note captures the observed runtime/operator gaps before the Codex macOS readiness changes and the target architecture now implemented in this branch. + +## Baseline Gaps + +1. Daemon and in-process runtime could diverge without an explicit attach path, creating split-brain risk. +2. `system status` and monitor surfaces depended on local process state and did not reliably reflect detached daemon reality. +3. The terminal dashboard path was placeholder/fallback oriented and not wired to live telemetry. +4. MCP service profile support did not include Desktop Commander and lacked standardized health/registration diagnostics. +5. MCP bridge calls to external orchestrators did not expose clear timeout/retry semantics and structured error responses. + +## Implemented Runtime Model + +1. **Single-authority daemon state** + - Detached daemon publishes socket-based runtime APIs and periodic runtime snapshots. + - CLI commands can query daemon state directly (`status`, telemetry watch, shutdown/restart control). +2. **Split-brain prevention** + - Local `system start` path blocks when daemon is active unless an explicit override is supplied. + - Dashboard defaults to daemon attach if available. +3. **Production-capable TUI** + - Ink-based TUI reads live snapshots from either daemon or local runtime. + - Fallback mode remains only for missing optional dependencies. +4. **Profile-driven MCP operations** + - Filesystem + Playwright + Desktop Commander are first-class MCP profiles. + - Health checks, required env reporting, and Codex MCP registration helpers are exposed through CLI. +5. **Hardened bridge semantics** + - HTTP bridge path includes timeout/retry/backoff and structured responses for both success and failure envelopes. + +## Operational Result + +The operator path now has a deterministic lifecycle: + +- Start/attach/status/stop/restart all converge on daemon-backed state when detached mode is used. +- TUI and monitor views no longer require guessing which runtime is authoritative. +- MCP profile setup and Codex registration can be validated via a single doctor workflow. diff --git a/docs/runbooks/autoscaler-daemon-coordination.md b/docs/runbooks/autoscaler-daemon-coordination.md index 7aa4810..89d5cc4 100644 --- a/docs/runbooks/autoscaler-daemon-coordination.md +++ b/docs/runbooks/autoscaler-daemon-coordination.md @@ -1,282 +1,135 @@ -# Autoscaler-Daemon Coordination Runbook +# Autoscaler And Daemon Coordination Runbook -This runbook documents how autoscaling and the background daemon interact, plus supported operational commands for Codex-Synaptic. +Last updated: 2026-02-13 -## 1. Overview +This runbook documents how autoscaling behavior relates to detached daemon operation, and how to run status/monitoring commands without introducing split-brain runtime behavior. -The autoscaler evaluates resource pressure and proposes up/down adjustments. The background daemon executes persistent lifecycle coordination. +## 1. Runtime Authority Model -### Key relationship +- The detached daemon is the authoritative runtime when started with `background start`. +- `system status`, `system monitor`, and `background attach` can read daemon-backed state. +- If daemon mode is active, local in-process startup is blocked by default to avoid running two independent orchestrators. -- Autoscaler computes scaling decisions from utilization signals. -- Daemon-backed coordination is required for reliable background scale-down execution. -- If the daemon is offline, scale-down intent is recorded but cleanup may be delayed. - -## 2. Autoscaling behavior - -### Scale-up - -Trigger: utilization above threshold. - -Behavior: - -- New worker replicas are deployed. -- Events are persisted to the `autoscaler_events` memory namespace. - -Command: - -```bash -codex-synaptic memory list autoscaler_events --limit 10 -``` - -### Scale-down - -Trigger: utilization below threshold. - -Behavior: - -- Autoscaler attempts to retire idle capacity. -- When daemon coordination is unavailable, retirement is deferred and warnings/events are emitted. - -Command: +Override (use sparingly): ```bash -codex-synaptic system status +CODEX_ALLOW_LOCAL_WITH_DAEMON=1 node dist/cli/index.js system start ``` -### Cooldown +## 2. Why This Matters For Autoscaling -Scale-up and scale-down both respect cooldown windows to avoid thrashing. +Autoscaler decisions and lifecycle actions are only reliable when all operator surfaces look at the same runtime authority. -## 3. Daemon dependency +Before this update, it was possible to read local session state while a daemon was active. The CLI now routes status/monitor surfaces to daemon state when available, preventing silent drift between dashboards and detached runtime behavior. -### Why scale-down depends on daemon coordination +## 3. Standard Operational Modes -The background daemon (`src/cli/daemon-manager.ts`) holds persistent process coordination state used by detached/background workflows. +### Production / Long-Running Mode (Recommended) -When daemon is offline: - -- Foreground operations still run. -- Scale-down cleanup can be delayed. -- `autoscaler_events` will include deferred/diagnostic records. - -### Check daemon state +Use detached mode and attach dashboards: ```bash -# Check daemon state -codex-synaptic background status - -# Inspect daemon logs (project-local) -tail -n 50 logs/daemon.log +node dist/cli/index.js background start +node dist/cli/index.js background status +node dist/cli/index.js background attach --watch --interval 2000 +node dist/cli/index.js tui --attach-daemon --interval 1000 ``` -## 4. Operational modes - -### Production mode (recommended) +### Local Debug Mode -Configuration: - -- Daemon: running continuously. -- Autoscaler: enabled (`scaling.enabled: true`). - -Commands: +Run an in-process orchestrator when detached daemon is not active: ```bash -codex-synaptic background start -grep -E '"scaling"|"enabled"' config/system.json +node dist/cli/index.js system start +node dist/cli/index.js system monitor --interval 2000 +node dist/cli/index.js system stop ``` -### Testing mode (swarm/perf tests) - -Configuration: +### Test Isolation Mode -- Daemon: stopped during isolated tests. -- Autoscaler: paused (`scaling.enabled: false`). - -Procedure: +If testing requires deterministic local behavior, stop daemon first: ```bash -# 1) Stop daemon -codex-synaptic background stop - -# 2) Disable autoscaler in config/system.json -# set: "scaling": { "enabled": false } - -# 3) Run test workload -codex-synaptic hive-mind spawn "performance test" --codex --dry-run - -# 4) Inspect agent registry state -codex-synaptic agent list - -# 5) Re-enable autoscaler and restart daemon -# set: "scaling": { "enabled": true } -codex-synaptic background start +node dist/cli/index.js background stop --timeout 10000 +node dist/cli/index.js system start ``` -### Development mode - -Configuration: +## 4. Command Reference (Current CLI Surface) -- Daemon: optional. -- Autoscaler: usually disabled for predictable debugging. - -Commands: +### Daemon Lifecycle ```bash -codex-synaptic agent deploy --type code_worker --replicas 3 -codex-synaptic agent deploy --type consensus_coordinator --replicas 2 +node dist/cli/index.js background start +node dist/cli/index.js background status +node dist/cli/index.js background attach --watch +node dist/cli/index.js background logs --tail 100 +node dist/cli/index.js background restart --timeout 10000 +node dist/cli/index.js background stop --timeout 10000 ``` -## 5. Command reference (supported) - -### Daemon management +### Runtime Status And Telemetry ```bash -codex-synaptic background status -codex-synaptic background start -codex-synaptic background stop - -# restart sequence -codex-synaptic background stop -codex-synaptic background start +node dist/cli/index.js system status +node dist/cli/index.js system monitor --interval 2000 +node dist/cli/index.js tui --attach-daemon +node dist/cli/index.js doctor --strict ``` -### Autoscaler configuration checks - -```bash -rg '"scaling"|"enabled"|"minAgents"|"maxAgents"|"scaleUpThreshold"|"scaleDownThreshold"|"cooldownMs"' config/system.json -``` +## 5. Troubleshooting -### Agent management +### Symptom: `system start` refuses to start -```bash -codex-synaptic agent list -codex-synaptic agent status -codex-synaptic agent deploy --type --replicas -``` +Cause: detached daemon already running. -## 6. Troubleshooting - -### Symptom: scale-down warnings - -Cause: daemon offline or unable to process retirement coordination. - -Resolution: +Check: ```bash -codex-synaptic background status -codex-synaptic background start -codex-synaptic memory list autoscaler_events --limit 20 -``` - -### Symptom: idle capacity persists - -Cause: deferred cleanup while daemon was unavailable. - -Diagnosis: - -```bash -codex-synaptic agent list -codex-synaptic background status -codex-synaptic memory list autoscaler_events --limit 20 +node dist/cli/index.js background status ``` Resolution: -```bash -codex-synaptic background start -# allow cooldown window, then re-check -codex-synaptic system status -codex-synaptic agent list -``` - -### Symptom: autoscaler not scaling up +1. Preferred: use attach/monitor commands against daemon. +2. Alternative: stop daemon first, then start local session. +3. Last resort: set `CODEX_ALLOW_LOCAL_WITH_DAEMON=1` if dual runtime is intentional. -Cause: scaling disabled or configured limits reached. +### Symptom: Dashboard shows no daemon telemetry -Diagnosis: +Check: ```bash -rg '"scaling"|"enabled"|"maxAgents"|"minAgents"' config/system.json -codex-synaptic agent list +node dist/cli/index.js background status +node dist/cli/index.js background logs --tail 100 ``` Resolution: ```bash -# verify scaling.enabled=true in config/system.json -# optionally add temporary capacity manually: -codex-synaptic agent deploy --type --replicas +node dist/cli/index.js background restart +node dist/cli/index.js background attach --watch ``` -### Symptom: daemon fails to start - -Cause: stale daemon state or environment/runtime issue. - -Diagnosis: - -```bash -codex-synaptic background status -tail -n 100 logs/daemon.log -``` +### Symptom: Autoscaling appears ineffective or stale -Resolution: +Run an authoritative health sweep: ```bash -rm -f ~/.codex-synaptic/daemon.json -codex-synaptic background start +node dist/cli/index.js system status +node dist/cli/index.js system monitor --interval 2000 +node dist/cli/index.js doctor --strict ``` -## 7. Best practices - -### Hive-mind/performance testing - -1. Before test: - - `codex-synaptic background stop` - - disable autoscaler in `config/system.json` - - `codex-synaptic agent list` -2. During test: - - run workload in an isolated thread/worktree - - periodically `codex-synaptic system status` -3. After test: - - `codex-synaptic agent list` - - re-enable autoscaler - - `codex-synaptic background start` - -### Production - -- Keep daemon running. -- Keep autoscaler enabled. -- Monitor `autoscaler_events` for repeated deferred cleanups. - -## 8. Monitoring & observability - -### Useful checks +If daemon is offline, start it and re-check: ```bash -# registry snapshot -codex-synaptic agent list - -# system + telemetry snapshot -codex-synaptic system status - -# autoscaler event history -codex-synaptic memory list autoscaler_events --limit 20 - -# daemon health -codex-synaptic background status +node dist/cli/index.js background start +node dist/cli/index.js background status ``` -### Event namespaces - -- `autoscaler_events`: scale decisions and coordination outcomes -- `agent_lifecycle`: worker deploy/unregister signals -- `mesh_events`: topology changes -- `consensus_events`: consensus outcomes - -## 9. Configuration reference +## 6. Configuration Reference -### Autoscaler settings (`config/system.json`) +Autoscaling configuration is defined in `config/system.json` under `scaling`, for example: ```json { @@ -291,14 +144,15 @@ codex-synaptic background status } ``` -### Related docs +After changing scaling config, restart runtime authority to apply changes: -- `docs/runbooks/validation-gating.md` -- `docs/observability/README.md` -- `docs/codex-synaptic-cheat-codes.md` -- `AGENTS.md` +```bash +node dist/cli/index.js background restart +``` ---- +## 7. Related Docs -Last updated: 2026-02-11 -Maintainer: Codex-Synaptic Platform Team +- `docs/guides/codex-macos-workflows.md` +- `docs/mcp/README.md` +- `docs/observability/README.md` +- `docs/reports/runtime-architecture-delta-2026-02-13.md` diff --git a/package-lock.json b/package-lock.json index d2b7f7d..7c0a028 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,11 +7,12 @@ "": { "name": "codex-synaptic", "version": "1.0.0", - "license": "MIT", + "license": "AGPL-3.0-only", "dependencies": { "chalk": "^5.6.2", "commander": "^14.0.0", "crypto-js": "^4.2.0", + "ink": "^5.1.0", "inquirer": "^12.9.4", "js-yaml": "^4.1.1", "openai": "^6.5.0", @@ -43,6 +44,19 @@ "vitest": "^1.6.1" } }, + "node_modules/@alcalzone/ansi-tokenize": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@alcalzone/ansi-tokenize/-/ansi-tokenize-0.1.3.tgz", + "integrity": "sha512-3yWxPTq3UQ/FY9p1ErPxIyfT64elWaMvM9lIHnaqpyft63tkxodF5aUElYHrdisWve5cETkh1+KBw1yJuW0aRw==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=14.13.1" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -56,17 +70,6 @@ "node": ">=12" } }, - "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -459,9 +462,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", - "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, "license": "MIT", "dependencies": { @@ -478,9 +481,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "license": "MIT", "engines": { @@ -488,13 +491,13 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", - "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.6", + "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -527,19 +530,22 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", - "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", "dev": true, "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/core": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", - "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -550,9 +556,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", - "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", + "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", "dev": true, "license": "MIT", "dependencies": { @@ -562,7 +568,7 @@ "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, @@ -621,9 +627,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.35.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.35.0.tgz", - "integrity": "sha512-30iXE9whjlILfWobBkNerJo+TXYsgVM5ERQwMcMKCHckHflCmf7wXDAHlARoWnh0s1U72WqlbeyE7iAcCzuCPw==", + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz", + "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==", "dev": true, "license": "MIT", "engines": { @@ -634,9 +640,9 @@ } }, "node_modules/@eslint/object-schema": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", - "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -644,13 +650,13 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", - "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.15.2", + "@eslint/core": "^0.17.0", "levn": "^0.4.1" }, "engines": { @@ -716,17 +722,26 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@inquirer/ansi": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/ansi/-/ansi-1.0.2.tgz", + "integrity": "sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/@inquirer/checkbox": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.2.2.tgz", - "integrity": "sha512-E+KExNurKcUJJdxmjglTl141EwxWyAHplvsYJQgSwXf8qiNWkTxTuCCqmhFEmbIXd4zLaGMfQFJ6WrZ7fSeV3g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.3.2.tgz", + "integrity": "sha512-VXukHf0RR1doGe6Sm4F0Em7SWYLTHSsbGfJdS9Ja2bX5/D5uwVOEjr07cncLROdBvmnvCATYEWlHqYmXv2IlQA==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/figures": "^1.0.13", - "@inquirer/type": "^3.0.8", - "ansi-escapes": "^4.3.2", - "yoctocolors-cjs": "^2.1.2" + "@inquirer/ansi": "^1.0.2", + "@inquirer/core": "^10.3.2", + "@inquirer/figures": "^1.0.15", + "@inquirer/type": "^3.0.10", + "yoctocolors-cjs": "^2.1.3" }, "engines": { "node": ">=18" @@ -741,13 +756,13 @@ } }, "node_modules/@inquirer/confirm": { - "version": "5.1.16", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.16.tgz", - "integrity": "sha512-j1a5VstaK5KQy8Mu8cHmuQvN1Zc62TbLhjJxwHvKPPKEoowSF6h/0UdOpA9DNdWZ+9Inq73+puRq1df6OJ8Sag==", + "version": "5.1.21", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.21.tgz", + "integrity": "sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/type": "^3.0.8" + "@inquirer/core": "^10.3.2", + "@inquirer/type": "^3.0.10" }, "engines": { "node": ">=18" @@ -762,19 +777,19 @@ } }, "node_modules/@inquirer/core": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.2.0.tgz", - "integrity": "sha512-NyDSjPqhSvpZEMZrLCYUquWNl+XC/moEcVFqS55IEYIYsY0a1cUCevSqk7ctOlnm/RaSBU5psFryNlxcmGrjaA==", + "version": "10.3.2", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.3.2.tgz", + "integrity": "sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A==", "license": "MIT", "dependencies": { - "@inquirer/figures": "^1.0.13", - "@inquirer/type": "^3.0.8", - "ansi-escapes": "^4.3.2", + "@inquirer/ansi": "^1.0.2", + "@inquirer/figures": "^1.0.15", + "@inquirer/type": "^3.0.10", "cli-width": "^4.1.0", "mute-stream": "^2.0.0", "signal-exit": "^4.1.0", "wrap-ansi": "^6.2.0", - "yoctocolors-cjs": "^2.1.2" + "yoctocolors-cjs": "^2.1.3" }, "engines": { "node": ">=18" @@ -788,6 +803,62 @@ } } }, + "node_modules/@inquirer/core/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@inquirer/core/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/@inquirer/core/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@inquirer/core/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@inquirer/core/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@inquirer/core/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -803,14 +874,14 @@ } }, "node_modules/@inquirer/editor": { - "version": "4.2.18", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.2.18.tgz", - "integrity": "sha512-yeQN3AXjCm7+Hmq5L6Dm2wEDeBRdAZuyZ4I7tWSSanbxDzqM0KqzoDbKM7p4ebllAYdoQuPJS6N71/3L281i6w==", + "version": "4.2.23", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.2.23.tgz", + "integrity": "sha512-aLSROkEwirotxZ1pBaP8tugXRFCxW94gwrQLxXfrZsKkfjOYC1aRvAZuhpJOb5cu4IBTJdsCigUlf2iCOu4ZDQ==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/external-editor": "^1.0.1", - "@inquirer/type": "^3.0.8" + "@inquirer/core": "^10.3.2", + "@inquirer/external-editor": "^1.0.3", + "@inquirer/type": "^3.0.10" }, "engines": { "node": ">=18" @@ -825,14 +896,14 @@ } }, "node_modules/@inquirer/expand": { - "version": "4.0.18", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.18.tgz", - "integrity": "sha512-xUjteYtavH7HwDMzq4Cn2X4Qsh5NozoDHCJTdoXg9HfZ4w3R6mxV1B9tL7DGJX2eq/zqtsFjhm0/RJIMGlh3ag==", + "version": "4.0.23", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.23.tgz", + "integrity": "sha512-nRzdOyFYnpeYTTR2qFwEVmIWypzdAx/sIkCMeTNTcflFOovfqUk+HcFhQQVBftAh9gmGrpFj6QcGEqrDMDOiew==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/type": "^3.0.8", - "yoctocolors-cjs": "^2.1.2" + "@inquirer/core": "^10.3.2", + "@inquirer/type": "^3.0.10", + "yoctocolors-cjs": "^2.1.3" }, "engines": { "node": ">=18" @@ -847,13 +918,13 @@ } }, "node_modules/@inquirer/external-editor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.1.tgz", - "integrity": "sha512-Oau4yL24d2B5IL4ma4UpbQigkVhzPDXLoqy1ggK4gnHg/stmkffJE4oOXHXF3uz0UEpywG68KcyXsyYpA1Re/Q==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.3.tgz", + "integrity": "sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==", "license": "MIT", "dependencies": { - "chardet": "^2.1.0", - "iconv-lite": "^0.6.3" + "chardet": "^2.1.1", + "iconv-lite": "^0.7.0" }, "engines": { "node": ">=18" @@ -868,22 +939,22 @@ } }, "node_modules/@inquirer/figures": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.13.tgz", - "integrity": "sha512-lGPVU3yO9ZNqA7vTYz26jny41lE7yoQansmqdMLBEfqaGsmdg7V3W9mK9Pvb5IL4EVZ9GnSDGMO/cJXud5dMaw==", + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.15.tgz", + "integrity": "sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@inquirer/input": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.2.2.tgz", - "integrity": "sha512-hqOvBZj/MhQCpHUuD3MVq18SSoDNHy7wEnQ8mtvs71K8OPZVXJinOzcvQna33dNYLYE4LkA9BlhAhK6MJcsVbw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.3.1.tgz", + "integrity": "sha512-kN0pAM4yPrLjJ1XJBjDxyfDduXOuQHrBB8aLDMueuwUGn+vNpF7Gq7TvyVxx8u4SHlFFj4trmj+a2cbpG4Jn1g==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/type": "^3.0.8" + "@inquirer/core": "^10.3.2", + "@inquirer/type": "^3.0.10" }, "engines": { "node": ">=18" @@ -898,13 +969,13 @@ } }, "node_modules/@inquirer/number": { - "version": "3.0.18", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.18.tgz", - "integrity": "sha512-7exgBm52WXZRczsydCVftozFTrrwbG5ySE0GqUd2zLNSBXyIucs2Wnm7ZKLe/aUu6NUg9dg7Q80QIHCdZJiY4A==", + "version": "3.0.23", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.23.tgz", + "integrity": "sha512-5Smv0OK7K0KUzUfYUXDXQc9jrf8OHo4ktlEayFlelCjwMXz0299Y8OrI+lj7i4gCBY15UObk76q0QtxjzFcFcg==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/type": "^3.0.8" + "@inquirer/core": "^10.3.2", + "@inquirer/type": "^3.0.10" }, "engines": { "node": ">=18" @@ -919,14 +990,14 @@ } }, "node_modules/@inquirer/password": { - "version": "4.0.18", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.18.tgz", - "integrity": "sha512-zXvzAGxPQTNk/SbT3carAD4Iqi6A2JS2qtcqQjsL22uvD+JfQzUrDEtPjLL7PLn8zlSNyPdY02IiQjzoL9TStA==", + "version": "4.0.23", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.23.tgz", + "integrity": "sha512-zREJHjhT5vJBMZX/IUbyI9zVtVfOLiTO66MrF/3GFZYZ7T4YILW5MSkEYHceSii/KtRk+4i3RE7E1CUXA2jHcA==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/type": "^3.0.8", - "ansi-escapes": "^4.3.2" + "@inquirer/ansi": "^1.0.2", + "@inquirer/core": "^10.3.2", + "@inquirer/type": "^3.0.10" }, "engines": { "node": ">=18" @@ -941,21 +1012,21 @@ } }, "node_modules/@inquirer/prompts": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.8.4.tgz", - "integrity": "sha512-MuxVZ1en1g5oGamXV3DWP89GEkdD54alcfhHd7InUW5BifAdKQEK9SLFa/5hlWbvuhMPlobF0WAx7Okq988Jxg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.10.1.tgz", + "integrity": "sha512-Dx/y9bCQcXLI5ooQ5KyvA4FTgeo2jYj/7plWfV5Ak5wDPKQZgudKez2ixyfz7tKXzcJciTxqLeK7R9HItwiByg==", "license": "MIT", "dependencies": { - "@inquirer/checkbox": "^4.2.2", - "@inquirer/confirm": "^5.1.16", - "@inquirer/editor": "^4.2.18", - "@inquirer/expand": "^4.0.18", - "@inquirer/input": "^4.2.2", - "@inquirer/number": "^3.0.18", - "@inquirer/password": "^4.0.18", - "@inquirer/rawlist": "^4.1.6", - "@inquirer/search": "^3.1.1", - "@inquirer/select": "^4.3.2" + "@inquirer/checkbox": "^4.3.2", + "@inquirer/confirm": "^5.1.21", + "@inquirer/editor": "^4.2.23", + "@inquirer/expand": "^4.0.23", + "@inquirer/input": "^4.3.1", + "@inquirer/number": "^3.0.23", + "@inquirer/password": "^4.0.23", + "@inquirer/rawlist": "^4.1.11", + "@inquirer/search": "^3.2.2", + "@inquirer/select": "^4.4.2" }, "engines": { "node": ">=18" @@ -970,14 +1041,14 @@ } }, "node_modules/@inquirer/rawlist": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.1.6.tgz", - "integrity": "sha512-KOZqa3QNr3f0pMnufzL7K+nweFFCCBs6LCXZzXDrVGTyssjLeudn5ySktZYv1XiSqobyHRYYK0c6QsOxJEhXKA==", + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.1.11.tgz", + "integrity": "sha512-+LLQB8XGr3I5LZN/GuAHo+GpDJegQwuPARLChlMICNdwW7OwV2izlCSCxN6cqpL0sMXmbKbFcItJgdQq5EBXTw==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/type": "^3.0.8", - "yoctocolors-cjs": "^2.1.2" + "@inquirer/core": "^10.3.2", + "@inquirer/type": "^3.0.10", + "yoctocolors-cjs": "^2.1.3" }, "engines": { "node": ">=18" @@ -992,15 +1063,15 @@ } }, "node_modules/@inquirer/search": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.1.1.tgz", - "integrity": "sha512-TkMUY+A2p2EYVY3GCTItYGvqT6LiLzHBnqsU1rJbrpXUijFfM6zvUx0R4civofVwFCmJZcKqOVwwWAjplKkhxA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.2.2.tgz", + "integrity": "sha512-p2bvRfENXCZdWF/U2BXvnSI9h+tuA8iNqtUKb9UWbmLYCRQxd8WkvwWvYn+3NgYaNwdUkHytJMGG4MMLucI1kA==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/figures": "^1.0.13", - "@inquirer/type": "^3.0.8", - "yoctocolors-cjs": "^2.1.2" + "@inquirer/core": "^10.3.2", + "@inquirer/figures": "^1.0.15", + "@inquirer/type": "^3.0.10", + "yoctocolors-cjs": "^2.1.3" }, "engines": { "node": ">=18" @@ -1015,16 +1086,16 @@ } }, "node_modules/@inquirer/select": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.3.2.tgz", - "integrity": "sha512-nwous24r31M+WyDEHV+qckXkepvihxhnyIaod2MG7eCE6G0Zm/HUF6jgN8GXgf4U7AU6SLseKdanY195cwvU6w==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.4.2.tgz", + "integrity": "sha512-l4xMuJo55MAe+N7Qr4rX90vypFwCajSakx59qe/tMaC1aEHWLyw68wF4o0A4SLAY4E0nd+Vt+EyskeDIqu1M6w==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/figures": "^1.0.13", - "@inquirer/type": "^3.0.8", - "ansi-escapes": "^4.3.2", - "yoctocolors-cjs": "^2.1.2" + "@inquirer/ansi": "^1.0.2", + "@inquirer/core": "^10.3.2", + "@inquirer/figures": "^1.0.15", + "@inquirer/type": "^3.0.10", + "yoctocolors-cjs": "^2.1.3" }, "engines": { "node": ">=18" @@ -1039,9 +1110,9 @@ } }, "node_modules/@inquirer/type": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.8.tgz", - "integrity": "sha512-lg9Whz8onIHRthWaN1Q9EGLa/0LFJjyM8mEUbL1eTi6yMGvBf8gvyDLtxSXztQsxMvhxxNpJYrwa1YHdq+w4Jw==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.10.tgz", + "integrity": "sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA==", "license": "MIT", "engines": { "node": ">=18" @@ -1085,42 +1156,15 @@ "dev": true, "license": "MIT" }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "license": "MIT", "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@npmcli/fs": { @@ -1150,9 +1194,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.50.2.tgz", - "integrity": "sha512-uLN8NAiFVIRKX9ZQha8wy6UUs06UNSZ32xj6giK/rmMXAgKahwExvK6SsmgU5/brh4w/nSgj8e0k3c1HBQpa0A==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.1.tgz", + "integrity": "sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==", "cpu": [ "arm" ], @@ -1164,9 +1208,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.50.2.tgz", - "integrity": "sha512-oEouqQk2/zxxj22PNcGSskya+3kV0ZKH+nQxuCCOGJ4oTXBdNTbv+f/E3c74cNLeMO1S5wVWacSws10TTSB77g==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.1.tgz", + "integrity": "sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==", "cpu": [ "arm64" ], @@ -1178,9 +1222,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.50.2.tgz", - "integrity": "sha512-OZuTVTpj3CDSIxmPgGH8en/XtirV5nfljHZ3wrNwvgkT5DQLhIKAeuFSiwtbMto6oVexV0k1F1zqURPKf5rI1Q==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.1.tgz", + "integrity": "sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==", "cpu": [ "arm64" ], @@ -1192,9 +1236,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.50.2.tgz", - "integrity": "sha512-Wa/Wn8RFkIkr1vy1k1PB//VYhLnlnn5eaJkfTQKivirOvzu5uVd2It01ukeQstMursuz7S1bU+8WW+1UPXpa8A==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.1.tgz", + "integrity": "sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==", "cpu": [ "x64" ], @@ -1206,9 +1250,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.50.2.tgz", - "integrity": "sha512-QkzxvH3kYN9J1w7D1A+yIMdI1pPekD+pWx7G5rXgnIlQ1TVYVC6hLl7SOV9pi5q9uIDF9AuIGkuzcbF7+fAhow==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.1.tgz", + "integrity": "sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==", "cpu": [ "arm64" ], @@ -1220,9 +1264,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.50.2.tgz", - "integrity": "sha512-dkYXB0c2XAS3a3jmyDkX4Jk0m7gWLFzq1C3qUnJJ38AyxIF5G/dyS4N9B30nvFseCfgtCEdbYFhk0ChoCGxPog==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.1.tgz", + "integrity": "sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==", "cpu": [ "x64" ], @@ -1234,9 +1278,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.50.2.tgz", - "integrity": "sha512-9VlPY/BN3AgbukfVHAB8zNFWB/lKEuvzRo1NKev0Po8sYFKx0i+AQlCYftgEjcL43F2h9Ui1ZSdVBc4En/sP2w==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.1.tgz", + "integrity": "sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==", "cpu": [ "arm" ], @@ -1248,9 +1292,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.50.2.tgz", - "integrity": "sha512-+GdKWOvsifaYNlIVf07QYan1J5F141+vGm5/Y8b9uCZnG/nxoGqgCmR24mv0koIWWuqvFYnbURRqw1lv7IBINw==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.1.tgz", + "integrity": "sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==", "cpu": [ "arm" ], @@ -1262,9 +1306,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.50.2.tgz", - "integrity": "sha512-df0Eou14ojtUdLQdPFnymEQteENwSJAdLf5KCDrmZNsy1c3YaCNaJvYsEUHnrg+/DLBH612/R0xd3dD03uz2dg==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.1.tgz", + "integrity": "sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==", "cpu": [ "arm64" ], @@ -1276,9 +1320,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.50.2.tgz", - "integrity": "sha512-iPeouV0UIDtz8j1YFR4OJ/zf7evjauqv7jQ/EFs0ClIyL+by++hiaDAfFipjOgyz6y6xbDvJuiU4HwpVMpRFDQ==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.1.tgz", + "integrity": "sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==", "cpu": [ "arm64" ], @@ -1290,9 +1334,23 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.50.2.tgz", - "integrity": "sha512-OL6KaNvBopLlj5fTa5D5bau4W82f+1TyTZRr2BdnfsrnQnmdxh4okMxR2DcDkJuh4KeoQZVuvHvzuD/lyLn2Kw==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.1.tgz", + "integrity": "sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.1.tgz", + "integrity": "sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==", "cpu": [ "loong64" ], @@ -1304,9 +1362,23 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.50.2.tgz", - "integrity": "sha512-I21VJl1w6z/K5OTRl6aS9DDsqezEZ/yKpbqlvfHbW0CEF5IL8ATBMuUx6/mp683rKTK8thjs/0BaNrZLXetLag==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.1.tgz", + "integrity": "sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.1.tgz", + "integrity": "sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==", "cpu": [ "ppc64" ], @@ -1318,9 +1390,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.50.2.tgz", - "integrity": "sha512-Hq6aQJT/qFFHrYMjS20nV+9SKrXL2lvFBENZoKfoTH2kKDOJqff5OSJr4x72ZaG/uUn+XmBnGhfr4lwMRrmqCQ==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.1.tgz", + "integrity": "sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==", "cpu": [ "riscv64" ], @@ -1332,9 +1404,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.50.2.tgz", - "integrity": "sha512-82rBSEXRv5qtKyr0xZ/YMF531oj2AIpLZkeNYxmKNN6I2sVE9PGegN99tYDLK2fYHJITL1P2Lgb4ZXnv0PjQvw==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.1.tgz", + "integrity": "sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==", "cpu": [ "riscv64" ], @@ -1346,9 +1418,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.50.2.tgz", - "integrity": "sha512-4Q3S3Hy7pC6uaRo9gtXUTJ+EKo9AKs3BXKc2jYypEcMQ49gDPFU2P1ariX9SEtBzE5egIX6fSUmbmGazwBVF9w==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.1.tgz", + "integrity": "sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==", "cpu": [ "s390x" ], @@ -1360,9 +1432,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.50.2.tgz", - "integrity": "sha512-9Jie/At6qk70dNIcopcL4p+1UirusEtznpNtcq/u/C5cC4HBX7qSGsYIcG6bdxj15EYWhHiu02YvmdPzylIZlA==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.1.tgz", + "integrity": "sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==", "cpu": [ "x64" ], @@ -1374,9 +1446,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.50.2.tgz", - "integrity": "sha512-HPNJwxPL3EmhzeAnsWQCM3DcoqOz3/IC6de9rWfGR8ZCuEHETi9km66bH/wG3YH0V3nyzyFEGUZeL5PKyy4xvw==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.1.tgz", + "integrity": "sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==", "cpu": [ "x64" ], @@ -1387,10 +1459,24 @@ "linux" ] }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.1.tgz", + "integrity": "sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.50.2.tgz", - "integrity": "sha512-nMKvq6FRHSzYfKLHZ+cChowlEkR2lj/V0jYj9JnGUVPL2/mIeFGmVM2mLaFeNa5Jev7W7TovXqXIG2d39y1KYA==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.1.tgz", + "integrity": "sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==", "cpu": [ "arm64" ], @@ -1402,9 +1488,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.50.2.tgz", - "integrity": "sha512-eFUvvnTYEKeTyHEijQKz81bLrUQOXKZqECeiWH6tb8eXXbZk+CXSG2aFrig2BQ/pjiVRj36zysjgILkqarS2YA==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.1.tgz", + "integrity": "sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==", "cpu": [ "arm64" ], @@ -1416,9 +1502,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.50.2.tgz", - "integrity": "sha512-cBaWmXqyfRhH8zmUxK3d3sAhEWLrtMjWBRwdMMHJIXSjvjLKvv49adxiEz+FJ8AP90apSDDBx2Tyd/WylV6ikA==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.1.tgz", + "integrity": "sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==", "cpu": [ "ia32" ], @@ -1429,10 +1515,24 @@ "win32" ] }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.1.tgz", + "integrity": "sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.50.2.tgz", - "integrity": "sha512-APwKy6YUhvZaEoHyM+9xqmTpviEI+9eL7LoCH+aLcvWYHJ663qG5zx7WzWZY+a9qkg5JtzcMyJ9z0WtQBMDmgA==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.1.tgz", + "integrity": "sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==", "cpu": [ "x64" ], @@ -1444,9 +1544,9 @@ ] }, "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -1461,9 +1561,9 @@ } }, "node_modules/@tsconfig/node10": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", - "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", "dev": true, "license": "MIT" }, @@ -1510,29 +1610,30 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "24.3.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.1.tgz", - "integrity": "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==", + "version": "24.10.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.13.tgz", + "integrity": "sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==", "devOptional": true, "license": "MIT", "peer": true, "dependencies": { - "undici-types": "~7.10.0" + "undici-types": "~7.16.0" } }, "node_modules/@types/prop-types": { "version": "15.7.15", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@types/react": { "version": "18.3.28", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.28.tgz", "integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==", - "dev": true, + "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" @@ -1556,21 +1657,20 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.43.0.tgz", - "integrity": "sha512-8tg+gt7ENL7KewsKMKDHXR1vm8tt9eMxjJBYINf6swonlWgkYn5NwyIgXpbbDxTNU5DgpDFfj95prcTq2clIQQ==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.55.0.tgz", + "integrity": "sha512-1y/MVSz0NglV1ijHC8OT49mPJ4qhPYjiK08YUQVbIOyu+5k862LKUHFkpKHWu//zmr7hDR2rhwUm6gnCGNmGBQ==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.43.0", - "@typescript-eslint/type-utils": "8.43.0", - "@typescript-eslint/utils": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0", - "graphemer": "^1.4.0", - "ignore": "^7.0.0", + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.55.0", + "@typescript-eslint/type-utils": "8.55.0", + "@typescript-eslint/utils": "8.55.0", + "@typescript-eslint/visitor-keys": "8.55.0", + "ignore": "^7.0.5", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.1.0" + "ts-api-utils": "^2.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1580,24 +1680,24 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.43.0", + "@typescript-eslint/parser": "^8.55.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.43.0.tgz", - "integrity": "sha512-B7RIQiTsCBBmY+yW4+ILd6mF5h1FUwJsVvpqkrgpszYifetQ2Ke+Z4u6aZh0CblkUGIdR59iYVyXqqZGkZ3aBw==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.55.0.tgz", + "integrity": "sha512-4z2nCSBfVIMnbuu8uinj+f0o4qOeggYJLbjpPHka3KH1om7e+H9yLKTYgksTaHcGco+NClhhY2vyO3HsMH1RGw==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.43.0", - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0", - "debug": "^4.3.4" + "@typescript-eslint/scope-manager": "8.55.0", + "@typescript-eslint/types": "8.55.0", + "@typescript-eslint/typescript-estree": "8.55.0", + "@typescript-eslint/visitor-keys": "8.55.0", + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1612,15 +1712,15 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.43.0.tgz", - "integrity": "sha512-htB/+D/BIGoNTQYffZw4uM4NzzuolCoaA/BusuSIcC8YjmBYQioew5VUZAYdAETPjeed0hqCaW7EHg+Robq8uw==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.55.0.tgz", + "integrity": "sha512-zRcVVPFUYWa3kNnjaZGXSu3xkKV1zXy8M4nO/pElzQhFweb7PPtluDLQtKArEOGmjXoRjnUZ29NjOiF0eCDkcQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.43.0", - "@typescript-eslint/types": "^8.43.0", - "debug": "^4.3.4" + "@typescript-eslint/tsconfig-utils": "^8.55.0", + "@typescript-eslint/types": "^8.55.0", + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1634,14 +1734,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.43.0.tgz", - "integrity": "sha512-daSWlQ87ZhsjrbMLvpuuMAt3y4ba57AuvadcR7f3nl8eS3BjRc8L9VLxFLk92RL5xdXOg6IQ+qKjjqNEimGuAg==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.55.0.tgz", + "integrity": "sha512-fVu5Omrd3jeqeQLiB9f1YsuK/iHFOwb04bCtY4BSCLgjNbOD33ZdV6KyEqplHr+IlpgT0QTZ/iJ+wT7hvTx49Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0" + "@typescript-eslint/types": "8.55.0", + "@typescript-eslint/visitor-keys": "8.55.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1652,9 +1752,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.43.0.tgz", - "integrity": "sha512-ALC2prjZcj2YqqL5X/bwWQmHA2em6/94GcbB/KKu5SX3EBDOsqztmmX1kMkvAJHzxk7TazKzJfFiEIagNV3qEA==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.55.0.tgz", + "integrity": "sha512-1R9cXqY7RQd7WuqSN47PK9EDpgFUK3VqdmbYrvWJZYDd0cavROGn+74ktWBlmJ13NXUQKlZ/iAEQHI/V0kKe0Q==", "dev": true, "license": "MIT", "engines": { @@ -1669,17 +1769,17 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.43.0.tgz", - "integrity": "sha512-qaH1uLBpBuBBuRf8c1mLJ6swOfzCXryhKND04Igr4pckzSEW9JX5Aw9AgW00kwfjWJF0kk0ps9ExKTfvXfw4Qg==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.55.0.tgz", + "integrity": "sha512-x1iH2unH4qAt6I37I2CGlsNs+B9WGxurP2uyZLRz6UJoZWDBx9cJL1xVN/FiOmHEONEg6RIufdvyT0TEYIgC5g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0", - "@typescript-eslint/utils": "8.43.0", - "debug": "^4.3.4", - "ts-api-utils": "^2.1.0" + "@typescript-eslint/types": "8.55.0", + "@typescript-eslint/typescript-estree": "8.55.0", + "@typescript-eslint/utils": "8.55.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1694,9 +1794,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.43.0.tgz", - "integrity": "sha512-vQ2FZaxJpydjSZJKiSW/LJsabFFvV7KgLC5DiLhkBcykhQj8iK9BOaDmQt74nnKdLvceM5xmhaTF+pLekrxEkw==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.55.0.tgz", + "integrity": "sha512-ujT0Je8GI5BJWi+/mMoR0wxwVEQaxM+pi30xuMiJETlX80OPovb2p9E8ss87gnSVtYXtJoU9U1Cowcr6w2FE0w==", "dev": true, "license": "MIT", "engines": { @@ -1708,22 +1808,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.43.0.tgz", - "integrity": "sha512-7Vv6zlAhPb+cvEpP06WXXy/ZByph9iL6BQRBDj4kmBsW98AqEeQHlj/13X+sZOrKSo9/rNKH4Ul4f6EICREFdw==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.55.0.tgz", + "integrity": "sha512-EwrH67bSWdx/3aRQhCoxDaHM+CrZjotc2UCCpEDVqfCE+7OjKAGWNY2HsCSTEVvWH2clYQK8pdeLp42EVs+xQw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.43.0", - "@typescript-eslint/tsconfig-utils": "8.43.0", - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.1.0" + "@typescript-eslint/project-service": "8.55.0", + "@typescript-eslint/tsconfig-utils": "8.55.0", + "@typescript-eslint/types": "8.55.0", + "@typescript-eslint/visitor-keys": "8.55.0", + "debug": "^4.4.3", + "minimatch": "^9.0.5", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1737,16 +1836,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.43.0.tgz", - "integrity": "sha512-S1/tEmkUeeswxd0GGcnwuVQPFWo8NzZTOMxCvw8BX7OMxnNae+i8Tm7REQen/SwUIPoPqfKn7EaZ+YLpiB3k9g==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.55.0.tgz", + "integrity": "sha512-BqZEsnPGdYpgyEIkDC1BadNY8oMwckftxBT+C8W0g1iKPdeqKZBtTfnvcq0nf60u7MkjFO8RBvpRGZBPw4L2ow==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.43.0", - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0" + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.55.0", + "@typescript-eslint/types": "8.55.0", + "@typescript-eslint/typescript-estree": "8.55.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1761,13 +1860,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.43.0.tgz", - "integrity": "sha512-T+S1KqRD4sg/bHfLwrpF/K3gQLBM1n7Rp7OjjikjTEssI2YJzQpi5WXoynOaQ93ERIuq3O8RBTOUYDKszUCEHw==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.55.0.tgz", + "integrity": "sha512-AxNRwEie8Nn4eFS1FzDMJWIISMGoXMb037sgCBJ3UR6o0fQTzr2tqN9WT+DkWJPhIdQCfV7T6D387566VtnCJA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/types": "8.55.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -1838,9 +1937,9 @@ } }, "node_modules/@vitest/runner/node_modules/yocto-queue": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", - "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz", + "integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==", "dev": true, "license": "MIT", "engines": { @@ -1978,6 +2077,16 @@ "node": ">=8" } }, + "node_modules/aggregate-error/node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1996,15 +2105,15 @@ } }, "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz", + "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==", "license": "MIT", "dependencies": { - "type-fest": "^0.21.3" + "environment": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2020,15 +2129,12 @@ } }, "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" @@ -2093,6 +2199,18 @@ "node": "*" } }, + "node_modules/auto-bind": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-5.0.1.tgz", + "integrity": "sha512-ooviqdwwgfIfNmDwo94wlshcdzfO64XV0Cg6oDsDYBJfITDz1EngD2z7DkbvCWn+XIMsIqW27sEVF6qcpJrRcg==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2282,9 +2400,9 @@ } }, "node_modules/chardet": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.0.tgz", - "integrity": "sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.1.tgz", + "integrity": "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==", "license": "MIT" }, "node_modules/check-error": { @@ -2357,6 +2475,65 @@ "node": ">=6" } }, + "node_modules/cli-boxes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", + "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "license": "MIT", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", + "license": "MIT", + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, "node_modules/cli-width": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", @@ -2366,6 +2543,18 @@ "node": ">= 12" } }, + "node_modules/code-excerpt": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-4.0.0.tgz", + "integrity": "sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==", + "license": "MIT", + "dependencies": { + "convert-to-spaces": "^2.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2395,9 +2584,9 @@ } }, "node_modules/commander": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.0.tgz", - "integrity": "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", "license": "MIT", "engines": { "node": ">=20" @@ -2424,6 +2613,15 @@ "license": "ISC", "optional": true }, + "node_modules/convert-to-spaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz", + "integrity": "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -2456,13 +2654,13 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "devOptional": true, "license": "MIT", "dependencies": { @@ -2529,18 +2727,18 @@ "optional": true }, "node_modules/detect-libc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.0.tgz", - "integrity": "sha512-vEtk+OcP7VBRtQZ1EJ3bdgzSfBjgnEalLTp5zjJrS+2Z1w2KZly4SBdac/WDU3hhsNAZ9E8SC96ME4Ey8MZ7cg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "license": "Apache-2.0", "engines": { "node": ">=8" } }, "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -2558,9 +2756,9 @@ } }, "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", "license": "MIT" }, "node_modules/encoding": { @@ -2573,7 +2771,20 @@ "iconv-lite": "^0.6.2" } }, - "node_modules/end-of-stream": { + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/end-of-stream": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", @@ -2592,6 +2803,18 @@ "node": ">=6" } }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/err-code": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", @@ -2599,6 +2822,16 @@ "license": "MIT", "optional": true }, + "node_modules/es-toolkit": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.44.0.tgz", + "integrity": "sha512-6penXeZalaV88MM3cGkFZZfOoLGWshWWfdy0tWw/RlVVyhvMaWSBTOvXNeiW3e5FwdS5ePW0LGEu17zT139ktg==", + "license": "MIT", + "workspaces": [ + "docs", + "benchmarks" + ] + }, "node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", @@ -2652,26 +2885,25 @@ } }, "node_modules/eslint": { - "version": "9.35.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.35.0.tgz", - "integrity": "sha512-QePbBFMJFjgmlE+cXAlbHZbHpdFVS2E/6vzCy7aKlebddvl1vadiC4JFV5u/wqTkNUwEV8WrQi257jf5f06hrg==", + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.2.tgz", + "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", "dev": true, "license": "MIT", "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.0", - "@eslint/config-helpers": "^0.3.1", - "@eslint/core": "^0.15.2", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.35.0", - "@eslint/plugin-kit": "^0.3.5", + "@eslint/js": "9.39.2", + "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", - "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", @@ -2743,6 +2975,22 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/eslint/node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", @@ -2784,6 +3032,16 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/eslint/node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -2807,6 +3065,19 @@ "node": "*" } }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/espree": { "version": "10.4.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", @@ -2839,9 +3110,9 @@ } }, "node_modules/esquery": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -2918,52 +3189,64 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "license": "(MIT OR WTFPL)", + "node_modules/execa/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-glob": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", - "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "node_modules/execa/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "license": "MIT", "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.8" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">=8.6.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/execa/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" + "engines": { + "node": ">=14" }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", "engines": { - "node": ">= 6" + "node": ">=6" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2978,16 +3261,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fastq": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", - "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -3119,13 +3392,50 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/gauge/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "license": "ISC", + "node_modules/gauge/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT", "optional": true }, + "node_modules/gauge/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/gauge/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "optional": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", + "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-func-name": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", @@ -3159,7 +3469,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "license": "ISC", "optional": true, "dependencies": { @@ -3234,21 +3544,14 @@ "license": "ISC", "optional": true }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "license": "MIT" - }, "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=4" } }, "node_modules/has-unicode": { @@ -3315,15 +3618,19 @@ } }, "node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/ieee754": { @@ -3391,13 +3698,15 @@ } }, "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "license": "MIT", - "optional": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/infer-owner": { @@ -3431,18 +3740,66 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "license": "ISC" }, + "node_modules/ink": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ink/-/ink-5.2.1.tgz", + "integrity": "sha512-BqcUyWrG9zq5HIwW6JcfFHsIYebJkWWb4fczNah1goUO0vv5vneIlfwuS85twyJ5hYR/y18FlAYUxrO9ChIWVg==", + "license": "MIT", + "dependencies": { + "@alcalzone/ansi-tokenize": "^0.1.3", + "ansi-escapes": "^7.0.0", + "ansi-styles": "^6.2.1", + "auto-bind": "^5.0.1", + "chalk": "^5.3.0", + "cli-boxes": "^3.0.0", + "cli-cursor": "^4.0.0", + "cli-truncate": "^4.0.0", + "code-excerpt": "^4.0.0", + "es-toolkit": "^1.22.0", + "indent-string": "^5.0.0", + "is-in-ci": "^1.0.0", + "patch-console": "^2.0.0", + "react-reconciler": "^0.29.0", + "scheduler": "^0.23.0", + "signal-exit": "^3.0.7", + "slice-ansi": "^7.1.0", + "stack-utils": "^2.0.6", + "string-width": "^7.2.0", + "type-fest": "^4.27.0", + "widest-line": "^5.0.0", + "wrap-ansi": "^9.0.0", + "ws": "^8.18.0", + "yoga-layout": "~3.2.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/react": ">=18.0.0", + "react": ">=18.0.0", + "react-devtools-core": "^4.19.1" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react-devtools-core": { + "optional": true + } + } + }, "node_modules/inquirer": { - "version": "12.9.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-12.9.4.tgz", - "integrity": "sha512-5bV3LOgLtMAiJq1QpaUddfRrvaX59wiMYppS7z2jNRSQ64acI0yqx7WMxWhgymenSXOyD657g9tlsTjqGYM8sg==", + "version": "12.11.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-12.11.1.tgz", + "integrity": "sha512-9VF7mrY+3OmsAfjH3yKz/pLbJ5z22E23hENKw3/LNSaA/sAt3v49bDRY+Ygct1xwuKT+U+cBfTzjCPySna69Qw==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.2.0", - "@inquirer/prompts": "^7.8.4", - "@inquirer/type": "^3.0.8", - "ansi-escapes": "^4.3.2", + "@inquirer/ansi": "^1.0.2", + "@inquirer/core": "^10.3.2", + "@inquirer/prompts": "^7.10.1", + "@inquirer/type": "^3.0.10", "mute-stream": "^2.0.0", - "run-async": "^4.0.5", + "run-async": "^4.0.6", "rxjs": "^7.8.2" }, "engines": { @@ -3458,9 +3815,9 @@ } }, "node_modules/ip-address": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz", - "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", + "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", "license": "MIT", "optional": true, "engines": { @@ -3491,12 +3848,15 @@ } }, "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-glob": { @@ -3512,6 +3872,21 @@ "node": ">=0.10.0" } }, + "node_modules/is-in-ci": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-in-ci/-/is-in-ci-1.0.0.tgz", + "integrity": "sha512-eUuAjybVTHMYWm/U+vBO1sY/JOCgoPCXRxzdju0K+K0BiGW0SChEL1MLC0PoCIR1OlPo5YAp8HuQoUlsWEICwg==", + "license": "MIT", + "bin": { + "is-in-ci": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-lambda": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", @@ -3550,10 +3925,9 @@ "license": "ISC" }, "node_modules/js-tokens": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", - "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", - "dev": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "license": "MIT" }, "node_modules/js-yaml": { @@ -3665,12 +4039,6 @@ "loose-envify": "cli.js" } }, - "node_modules/loose-envify/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "license": "MIT" - }, "node_modules/loupe": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", @@ -3695,9 +4063,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.19", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.19.tgz", - "integrity": "sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==", + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", "dev": true, "license": "MIT", "dependencies": { @@ -3746,47 +4114,19 @@ "dev": true, "license": "MIT" }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "license": "MIT", "engines": { - "node": ">= 8" + "node": ">=6" } }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, - "license": "MIT", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", "license": "MIT", "engines": { "node": ">=10" @@ -4012,9 +4352,9 @@ } }, "node_modules/node-abi": { - "version": "3.77.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.77.0.tgz", - "integrity": "sha512-DSmt0OEcLoK4i3NuscSbGjOf3bqiDEutejqENSplMSFA/gmB8mkED9G4pKWnPl7MDU4rSHebKPHeitpDfyH0cQ==", + "version": "3.87.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.87.0.tgz", + "integrity": "sha512-+CGM1L1CgmtheLcBuleyYOn7NWPVu0s0EJH2C4puxgEZb9h8QpR9G2dBfZJOAUhi7VQxuBPMd0hiISWcTyiYyQ==", "license": "MIT", "dependencies": { "semver": "^7.3.5" @@ -4055,9 +4395,9 @@ } }, "node_modules/nodemon": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.10.tgz", - "integrity": "sha512-WDjw3pJ0/0jMFmyNDp3gvY2YizjLmmOUQo6DEBY+JgdvW/yQ9mEeSw6H5ythl5Ny2ytb7f9C2nIbjSxMNzbJXw==", + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.11.tgz", + "integrity": "sha512-is96t8F/1//UHAjNPHpbsNY46ELPpftGUoSVNXwUfMk/qdjSylYrWSu1XavVTBOn526kFiOR733ATgNBCQyH0g==", "dev": true, "license": "MIT", "dependencies": { @@ -4094,16 +4434,6 @@ "concat-map": "0.0.1" } }, - "node_modules/nodemon/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/nodemon/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -4117,19 +4447,6 @@ "node": "*" } }, - "node_modules/nodemon/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -4212,25 +4529,24 @@ } }, "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "license": "MIT", "dependencies": { - "mimic-fn": "^4.0.0" + "mimic-fn": "^2.1.0" }, "engines": { - "node": ">=12" + "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/openai": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/openai/-/openai-6.5.0.tgz", - "integrity": "sha512-bNqJ15Ijbs41KuJ2iYz/mGAruFHzQQt7zXo4EvjNLoB64aJdgn1jlMeDTsXjEg+idVYafg57QB/5Rd16oqvZ6A==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-6.21.0.tgz", + "integrity": "sha512-26dQFi76dB8IiN/WKGQOV+yKKTTlRCxQjoi2WLt0kMcH8pvxVyvfdBDkld5GTl7W1qvBpwVOtFcsqktj3fBRpA==", "license": "Apache-2.0", "bin": { "openai": "bin/cli" @@ -4327,6 +4643,15 @@ "node": ">=6" } }, + "node_modules/patch-console": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/patch-console/-/patch-console-2.0.0.tgz", + "integrity": "sha512-0YNdUceMdaQwoKce1gatDScmMo5pu/tfABfnzEqeG0gtTmd7mh/WcwgUjtAeOU7N8nFFlbQBnFK2gXW5fGvmMA==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4479,9 +4804,9 @@ } }, "node_modules/prettier": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz", + "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", "dev": true, "license": "MIT", "bin": { @@ -4570,27 +4895,6 @@ "node": ">=6" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -4620,6 +4924,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -4634,6 +4939,22 @@ "dev": true, "license": "MIT" }, + "node_modules/react-reconciler": { + "version": "0.29.2", + "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.29.2.tgz", + "integrity": "sha512-zZQqIiYgDCTP/f1N/mAR10nJGrPD2ZR+jDSEsKWJHYC7Cm2wodlwbR3upZRdC3cjIjSlTLNVyO7Iu0Yy7t2AYg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -4671,6 +4992,22 @@ "node": ">=4" } }, + "node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", @@ -4681,17 +5018,6 @@ "node": ">= 4" } }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -4710,9 +5036,9 @@ } }, "node_modules/rollup": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.2.tgz", - "integrity": "sha512-BgLRGy7tNS9H66aIMASq1qSYbAAJV6Z6WR4QYTvj5FgF15rZ/ympT1uixHXwzbZUBDbkvqUI1KR0fH1FhMaQ9w==", + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz", + "integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==", "dev": true, "license": "MIT", "dependencies": { @@ -4726,27 +5052,31 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.50.2", - "@rollup/rollup-android-arm64": "4.50.2", - "@rollup/rollup-darwin-arm64": "4.50.2", - "@rollup/rollup-darwin-x64": "4.50.2", - "@rollup/rollup-freebsd-arm64": "4.50.2", - "@rollup/rollup-freebsd-x64": "4.50.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.50.2", - "@rollup/rollup-linux-arm-musleabihf": "4.50.2", - "@rollup/rollup-linux-arm64-gnu": "4.50.2", - "@rollup/rollup-linux-arm64-musl": "4.50.2", - "@rollup/rollup-linux-loong64-gnu": "4.50.2", - "@rollup/rollup-linux-ppc64-gnu": "4.50.2", - "@rollup/rollup-linux-riscv64-gnu": "4.50.2", - "@rollup/rollup-linux-riscv64-musl": "4.50.2", - "@rollup/rollup-linux-s390x-gnu": "4.50.2", - "@rollup/rollup-linux-x64-gnu": "4.50.2", - "@rollup/rollup-linux-x64-musl": "4.50.2", - "@rollup/rollup-openharmony-arm64": "4.50.2", - "@rollup/rollup-win32-arm64-msvc": "4.50.2", - "@rollup/rollup-win32-ia32-msvc": "4.50.2", - "@rollup/rollup-win32-x64-msvc": "4.50.2", + "@rollup/rollup-android-arm-eabi": "4.57.1", + "@rollup/rollup-android-arm64": "4.57.1", + "@rollup/rollup-darwin-arm64": "4.57.1", + "@rollup/rollup-darwin-x64": "4.57.1", + "@rollup/rollup-freebsd-arm64": "4.57.1", + "@rollup/rollup-freebsd-x64": "4.57.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.57.1", + "@rollup/rollup-linux-arm-musleabihf": "4.57.1", + "@rollup/rollup-linux-arm64-gnu": "4.57.1", + "@rollup/rollup-linux-arm64-musl": "4.57.1", + "@rollup/rollup-linux-loong64-gnu": "4.57.1", + "@rollup/rollup-linux-loong64-musl": "4.57.1", + "@rollup/rollup-linux-ppc64-gnu": "4.57.1", + "@rollup/rollup-linux-ppc64-musl": "4.57.1", + "@rollup/rollup-linux-riscv64-gnu": "4.57.1", + "@rollup/rollup-linux-riscv64-musl": "4.57.1", + "@rollup/rollup-linux-s390x-gnu": "4.57.1", + "@rollup/rollup-linux-x64-gnu": "4.57.1", + "@rollup/rollup-linux-x64-musl": "4.57.1", + "@rollup/rollup-openbsd-x64": "4.57.1", + "@rollup/rollup-openharmony-arm64": "4.57.1", + "@rollup/rollup-win32-arm64-msvc": "4.57.1", + "@rollup/rollup-win32-ia32-msvc": "4.57.1", + "@rollup/rollup-win32-x64-gnu": "4.57.1", + "@rollup/rollup-win32-x64-msvc": "4.57.1", "fsevents": "~2.3.2" } }, @@ -4759,30 +5089,6 @@ "node": ">=0.12.0" } }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/rxjs": { "version": "7.8.2", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", @@ -4818,10 +5124,19 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -4868,16 +5183,10 @@ "license": "ISC" }, "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" }, "node_modules/simple-concat": { "version": "1.0.1", @@ -4937,6 +5246,37 @@ "node": ">=10" } }, + "node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -5025,6 +5365,27 @@ "node": ">= 8" } }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", @@ -5033,9 +5394,9 @@ "license": "MIT" }, "node_modules/std-env": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.9.0.tgz", - "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", "dev": true, "license": "MIT" }, @@ -5049,17 +5410,47 @@ } }, "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/strip-ansi": { @@ -5113,23 +5504,31 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/strip-literal/node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "has-flag": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=4" } }, "node_modules/tar": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "deprecated": "Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "license": "ISC", "dependencies": { "chownr": "^2.0.0", @@ -5193,6 +5592,55 @@ "dev": true, "license": "MIT" }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tinypool": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", @@ -5237,9 +5685,9 @@ } }, "node_modules/ts-api-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", - "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", + "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", "dev": true, "license": "MIT", "engines": { @@ -5335,21 +5783,21 @@ } }, "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "license": "(MIT OR CC0-1.0)", "engines": { - "node": ">=10" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/typescript": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", - "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", "peer": true, @@ -5362,9 +5810,9 @@ } }, "node_modules/ufo": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", - "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.3.tgz", + "integrity": "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==", "dev": true, "license": "MIT" }, @@ -5376,9 +5824,9 @@ "license": "MIT" }, "node_modules/undici-types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", - "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", "devOptional": true, "license": "MIT" }, @@ -5439,9 +5887,9 @@ "license": "MIT" }, "node_modules/vite": { - "version": "5.4.20", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.20.tgz", - "integrity": "sha512-j3lYzGC3P+B5Yfy/pfKNgVEg4+UtcIJcVRt2cDjIOmhLourAqPqf8P7acgxeiSgUB7E3p2P8/3gNIgDLpwzs4g==", + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", "dev": true, "license": "MIT", "dependencies": { @@ -5630,6 +6078,53 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, + "node_modules/wide-align/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT", + "optional": true + }, + "node_modules/wide-align/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wide-align/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "optional": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/widest-line": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-5.0.0.tgz", + "integrity": "sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA==", + "license": "MIT", + "dependencies": { + "string-width": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -5640,6 +6135,50 @@ "node": ">=0.10.0" } }, + "node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -5647,11 +6186,10 @@ "license": "ISC" }, "node_modules/ws": { - "version": "8.18.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", - "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz", + "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==", "license": "MIT", - "peer": true, "engines": { "node": ">=10.0.0" }, @@ -5709,6 +6247,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/yoga-layout": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/yoga-layout/-/yoga-layout-3.2.1.tgz", + "integrity": "sha512-0LPOt3AxKqMdFBZA3HBAt/t/8vIKq7VaQYbuA8WxCgung+p9TVyKRYdpvCb80HcdTN2NkbIKbhNwKUfm3tQywQ==", + "license": "MIT" + }, "node_modules/zod": { "version": "3.25.76", "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", diff --git a/package.json b/package.json index a650995..22c08a5 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "autonomous-agents" ], "author": "Parallax Analytics ", - "license": "MIT", + "license": "AGPL-3.0-only", "devDependencies": { "@types/estree": "^1.0.8", "@types/js-yaml": "^4.0.9", @@ -57,6 +57,7 @@ "chalk": "^5.6.2", "commander": "^14.0.0", "crypto-js": "^4.2.0", + "ink": "^5.1.0", "inquirer": "^12.9.4", "js-yaml": "^4.1.1", "openai": "^6.5.0", diff --git a/src/bridging/mcp-bridge.ts b/src/bridging/mcp-bridge.ts index cd76db3..50fed5a 100644 --- a/src/bridging/mcp-bridge.ts +++ b/src/bridging/mcp-bridge.ts @@ -1,14 +1,109 @@ /** - * MCP (Model Control Protocol) Bridge for external model integration + * MCP (Model Control Protocol) Bridge for external model integration. */ import { EventEmitter } from 'events'; +import { setTimeout as sleep } from 'timers/promises'; import { Logger } from '../core/logger.js'; +export class EndpointResolutionError extends Error { + constructor(message: string, cause?: Error) { + super(message); + this.name = 'EndpointResolutionError'; + if (cause) { + this.cause = cause; + } + } +} + +interface BridgeEndpoint { + name: string; + url: string; +} + +interface StructuredBridgeError { + code: string; + message: string; + endpoint: string; + attempt: number; + attempts: number; + retryable: boolean; + status?: number; + details?: Record; +} + +export interface MCPBridgeResponse { + ok: boolean; + endpoint: string; + attempts: number; + durationMs: number; + status?: number; + data?: unknown; + error?: StructuredBridgeError; +} + +export interface MCPBridgeStatus { + isRunning: boolean; + connectedEndpoints: Array<{ name: string; url: string }>; + retryAttempts: number; + timeoutMs: number; +} + +function parseIntEnv(name: string, fallback: number): number { + const raw = process.env[name]; + if (!raw) { + return fallback; + } + const parsed = Number.parseInt(raw, 10); + if (!Number.isFinite(parsed) || parsed < 0) { + return fallback; + } + return parsed; +} + +function endpointEnvKey(endpoint: string): string { + return endpoint + .replace(/[^a-zA-Z0-9]/g, '_') + .replace(/_+/g, '_') + .replace(/^_|_$/g, '') + .toUpperCase(); +} + +function parseHeadersEnv(raw?: string): Record { + if (!raw || !raw.trim()) { + return {}; + } + + try { + const parsed = JSON.parse(raw) as Record; + const headers: Record = {}; + for (const [key, value] of Object.entries(parsed)) { + if (typeof value === 'string') { + headers[key] = value; + } + } + return headers; + } catch { + return {}; + } +} + +function withTimeoutSignal(timeoutMs: number): { signal: AbortSignal; cancel: () => void } { + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), timeoutMs); + if (typeof timer.unref === 'function') { + timer.unref(); + } + return { + signal: controller.signal, + cancel: () => clearTimeout(timer) + }; +} + export class MCPBridge extends EventEmitter { private logger = Logger.getInstance(); private isRunning = false; - private connectedEndpoints: Map = new Map(); + private connectedEndpoints: Map = new Map(); constructor() { super(); @@ -28,28 +123,219 @@ export class MCPBridge extends EventEmitter { this.logger.info('mcp-bridge', 'MCP bridge shutdown complete'); } + private resolveEndpoint(endpoint: string): BridgeEndpoint { + const existing = this.connectedEndpoints.get(endpoint); + if (existing) { + return existing; + } + + if (/^https?:\/\//i.test(endpoint)) { + return { name: endpoint, url: endpoint }; + } + + const key = endpointEnvKey(endpoint); + const envUrl = process.env[`CODEX_MCP_ENDPOINT_${key}_URL`]; + if (envUrl && /^https?:\/\//i.test(envUrl)) { + return { name: endpoint, url: envUrl }; + } + + throw new EndpointResolutionError( + `Endpoint "${endpoint}" is not connected. Provide an HTTP URL endpoint or set CODEX_MCP_ENDPOINT_${key}_URL.` + ); + } + connectEndpoint(endpoint: string): Promise { - return new Promise((resolve) => { - this.connectedEndpoints.set(endpoint, { connected: true }); - this.logger.info('mcp-bridge', 'Endpoint connected', { endpoint }); - resolve(); + return new Promise((resolve, reject) => { + try { + const resolved = this.resolveEndpoint(endpoint); + this.connectedEndpoints.set(endpoint, resolved); + this.logger.info('mcp-bridge', 'Endpoint connected', { + endpoint, + url: resolved.url + }); + resolve(); + } catch (error) { + reject(error as Error); + } }); } - getStatus(): any { + getStatus(): MCPBridgeStatus { return { isRunning: this.isRunning, - connectedEndpoints: Array.from(this.connectedEndpoints.keys()) + connectedEndpoints: Array.from(this.connectedEndpoints.entries()).map(([name, value]) => ({ + name, + url: value.url + })), + retryAttempts: parseIntEnv('CODEX_MCP_BRIDGE_RETRY_ATTEMPTS', 2), + timeoutMs: parseIntEnv('CODEX_MCP_BRIDGE_TIMEOUT_MS', 8000) }; } - async sendMessage(endpoint: string, _message: unknown): Promise { - this.logger.info('mcp-bridge', `Sending message to endpoint ${endpoint}`); - // In a real implementation, this would send the message to the target endpoint - await new Promise((resolve) => setTimeout(resolve, 100)); - this.logger.info('mcp-bridge', 'Message sent successfully'); + private resolveHeaders(endpoint: string): Record { + const endpointKey = endpointEnvKey(endpoint); + const globalHeaders = parseHeadersEnv(process.env.CODEX_MCP_BRIDGE_HEADERS_JSON); + const endpointHeaders = parseHeadersEnv(process.env[`CODEX_MCP_${endpointKey}_HEADERS_JSON`]); + + const authEnv = process.env.CODEX_MCP_BRIDGE_AUTH_TOKEN_ENV || 'CODEX_MCP_BRIDGE_BEARER_TOKEN'; + const globalToken = process.env[authEnv]; + const endpointToken = process.env[`CODEX_MCP_${endpointKey}_BEARER_TOKEN`]; + + const headers: Record = { + 'content-type': 'application/json', + ...globalHeaders, + ...endpointHeaders + }; + + const token = endpointToken || globalToken; + if (token) { + headers.authorization = `Bearer ${token}`; + } + + return headers; + } + + async sendMessage(endpoint: string, message: unknown): Promise { + const startedAt = Date.now(); + const resolved = this.resolveEndpoint(endpoint); + + const timeoutMs = parseIntEnv('CODEX_MCP_BRIDGE_TIMEOUT_MS', 8000); + const retryAttempts = parseIntEnv('CODEX_MCP_BRIDGE_RETRY_ATTEMPTS', 2); + const retryDelayMs = parseIntEnv('CODEX_MCP_BRIDGE_RETRY_DELAY_MS', 300); + const attempts = Math.max(1, retryAttempts + 1); + + this.logger.info('mcp-bridge', 'Sending MCP bridge message', { + endpoint, + url: resolved.url, + attempts, + timeoutMs + }); + + for (let attempt = 1; attempt <= attempts; attempt += 1) { + const { signal, cancel } = withTimeoutSignal(timeoutMs); + try { + const response = await fetch(resolved.url, { + method: 'POST', + headers: this.resolveHeaders(endpoint), + body: JSON.stringify(message ?? {}), + signal + }); + cancel(); + + const text = await response.text(); + let payload: unknown = text; + if (text) { + try { + payload = JSON.parse(text); + } catch { + // keep raw text + } + } + + if (response.ok) { + const durationMs = Date.now() - startedAt; + const result: MCPBridgeResponse = { + ok: true, + endpoint, + attempts: attempt, + durationMs, + status: response.status, + data: payload + }; + this.logger.info('mcp-bridge', 'MCP bridge message delivered', { + endpoint, + attempts: attempt, + status: response.status, + durationMs + }); + return result; + } + + const retryable = response.status >= 500 || response.status === 408 || response.status === 429; + const error: StructuredBridgeError = { + code: 'upstream_error', + message: `Upstream responded with HTTP ${response.status}`, + endpoint, + attempt, + attempts, + retryable, + status: response.status, + details: { + payload + } + }; + + if (retryable && attempt < attempts) { + this.logger.warn('mcp-bridge', 'Retrying MCP bridge request after upstream error', { + endpoint, + attempt, + status: response.status, + retryDelayMs + }); + await sleep(retryDelayMs * attempt); + continue; + } + + return { + ok: false, + endpoint, + attempts: attempt, + durationMs: Date.now() - startedAt, + status: response.status, + error + }; + } catch (error) { + cancel(); + + const isAbort = (error as Error).name === 'AbortError'; + const retryable = true; + const bridgeError: StructuredBridgeError = { + code: isAbort ? 'timeout' : 'network_error', + message: isAbort ? `Timed out after ${timeoutMs}ms` : (error as Error).message, + endpoint, + attempt, + attempts, + retryable, + details: { + timeoutMs, + url: resolved.url + } + }; + + if (attempt < attempts) { + this.logger.warn('mcp-bridge', 'Retrying MCP bridge request after transport failure', { + endpoint, + attempt, + retryDelayMs, + reason: bridgeError.message + }); + await sleep(retryDelayMs * attempt); + continue; + } + + return { + ok: false, + endpoint, + attempts: attempt, + durationMs: Date.now() - startedAt, + error: bridgeError + }; + } + } + return { - response: 'Message received' + ok: false, + endpoint, + attempts: 0, + durationMs: Date.now() - startedAt, + error: { + code: 'unknown', + message: 'Unexpected bridge execution state', + endpoint, + attempt: 0, + attempts, + retryable: false + } }; } -} \ No newline at end of file +} diff --git a/src/cli/daemon-manager.ts b/src/cli/daemon-manager.ts index 69ddfc2..a9c7c34 100644 --- a/src/cli/daemon-manager.ts +++ b/src/cli/daemon-manager.ts @@ -1,11 +1,13 @@ import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'fs'; import { join, resolve } from 'path'; import { homedir } from 'os'; -import { fork, ChildProcess } from 'child_process'; +import { fork } from 'child_process'; +import { createConnection } from 'net'; +import { randomUUID } from 'crypto'; import type { InterfaceMode, InterfaceTier } from '../core/config.js'; /** - * IPC message types for daemon communication + * Legacy IPC message types for the forked daemon process channel. */ export type DaemonIPCMessage = | { type: 'setMode'; mode: InterfaceMode } @@ -14,11 +16,47 @@ export type DaemonIPCMessage = | { type: 'setTier'; tier: InterfaceTier } | { type: 'shutdown' }; +export interface DaemonRuntimeSnapshot { + pid: number; + startedAt: string; + updatedAt: string; + cwd: string; + interfaceMode: InterfaceMode; + tier: InterfaceTier; + status: { + initialized: boolean; + shuttingDown: boolean; + daemon: boolean; + }; + telemetry: { + agents: { + total: number; + available: number; + byType: Record; + byStatus: Record; + }; + resources?: any; + mesh?: any; + swarm?: any; + consensus?: any; + recentTasks: Array<{ + id: string; + status: 'completed' | 'failed'; + summary?: string; + timestamp: string; + }>; + }; +} + interface DaemonStateFile { pid: number; startedAt: string; interfaceMode: InterfaceMode; tier: InterfaceTier; + cwd: string; + socketPath: string; + runtimePath: string; + logFile: string; } export interface BackgroundStatus { @@ -27,10 +65,33 @@ export interface BackgroundStatus { startedAt?: string; interfaceMode?: InterfaceMode; tier?: InterfaceTier; + cwd?: string; + socketPath?: string; + runtimePath?: string; + logFile?: string; +} + +interface DaemonSocketRequest { + id: string; + type: 'status' | 'telemetry' | 'setMode' | 'setTier' | 'shutdown' | 'ping'; + payload?: Record; +} + +interface DaemonSocketResponse { + id: string; + ok: boolean; + result?: any; + error?: { + code: string; + message: string; + details?: Record; + }; } -const STATE_DIR = join(homedir(), '.codex-synaptic'); +const STATE_DIR = process.env.CODEX_SYNAPTIC_STATE_DIR || join(homedir(), '.codex-synaptic'); const STATE_FILE = join(STATE_DIR, 'daemon.json'); +const DEFAULT_SOCKET_FILE = join(STATE_DIR, 'daemon.sock'); +const DEFAULT_RUNTIME_FILE = join(STATE_DIR, 'daemon-runtime.json'); function ensureStateDir(): void { if (!existsSync(STATE_DIR)) { @@ -91,6 +152,28 @@ function resolveRunnerPath(): { path: string; isTypeScript: boolean } { return { path: tsCandidate, isTypeScript: true }; } +function getSocketPathFromState(state?: DaemonStateFile): string { + return state?.socketPath || DEFAULT_SOCKET_FILE; +} + +function getRuntimePathFromState(state?: DaemonStateFile): string { + return state?.runtimePath || DEFAULT_RUNTIME_FILE; +} + +export function getDaemonPaths(): { + stateDir: string; + stateFile: string; + socketFile: string; + runtimeFile: string; +} { + return { + stateDir: STATE_DIR, + stateFile: STATE_FILE, + socketFile: DEFAULT_SOCKET_FILE, + runtimeFile: DEFAULT_RUNTIME_FILE + }; +} + export function getBackgroundStatus(): BackgroundStatus { const state = readState(); if (!state) { @@ -107,10 +190,47 @@ export function getBackgroundStatus(): BackgroundStatus { pid: state.pid, startedAt: state.startedAt, interfaceMode: state.interfaceMode, - tier: state.tier + tier: state.tier, + cwd: state.cwd, + socketPath: state.socketPath, + runtimePath: state.runtimePath, + logFile: state.logFile }; } +export function getBackgroundRuntimeSnapshot(): DaemonRuntimeSnapshot | undefined { + const state = readState(); + const runtimeFile = getRuntimePathFromState(state); + + try { + if (!existsSync(runtimeFile)) { + return undefined; + } + const raw = readFileSync(runtimeFile, 'utf8'); + return JSON.parse(raw) as DaemonRuntimeSnapshot; + } catch { + return undefined; + } +} + +export async function queryBackgroundRuntimeSnapshot(timeoutMs = 2000): Promise { + const status = getBackgroundStatus(); + if (!status.running) { + return undefined; + } + + try { + const response = await sendDaemonRequest({ type: 'status' }, timeoutMs); + if (response.ok) { + return response.result as DaemonRuntimeSnapshot; + } + } catch { + // fall through to file snapshot + } + + return getBackgroundRuntimeSnapshot(); +} + export async function startBackgroundSystem(): Promise { const status = getBackgroundStatus(); if (status.running) { @@ -118,8 +238,10 @@ export async function startBackgroundSystem(): Promise { } const { path: runnerPath, isTypeScript } = resolveRunnerPath(); + const cwd = process.cwd(); const child = fork(runnerPath, [], { + cwd, detached: true, stdio: ['ignore', 'ignore', 'ignore', 'ipc'], execArgv: isTypeScript ? addTsNodeRegister(process.execArgv) : filterExecArgv(process.execArgv) @@ -153,10 +275,35 @@ export async function startBackgroundSystem(): Promise { if (typeof child.disconnect === 'function') { child.disconnect(); } - const interfaceMode = message.interfaceMode || 'cli'; - const tier = message.tier || 'intermediate'; - writeState({ pid: child.pid!, startedAt, interfaceMode, tier }); - resolvePromise({ running: true, pid: child.pid!, startedAt, interfaceMode, tier }); + + const interfaceMode = (message.interfaceMode || 'cli') as InterfaceMode; + const tier = (message.tier || 'intermediate') as InterfaceTier; + const socketPath = (message.socketPath || DEFAULT_SOCKET_FILE) as string; + const runtimePath = (message.runtimePath || DEFAULT_RUNTIME_FILE) as string; + const logFile = (message.logFile || join(cwd, 'logs', 'daemon.log')) as string; + + writeState({ + pid: child.pid!, + startedAt, + interfaceMode, + tier, + cwd, + socketPath, + runtimePath, + logFile + }); + + resolvePromise({ + running: true, + pid: child.pid!, + startedAt, + interfaceMode, + tier, + cwd, + socketPath, + runtimePath, + logFile + }); } else if (message.type === 'error') { cleanup(); rejectPromise(new Error(message.error)); @@ -171,7 +318,6 @@ export async function startBackgroundSystem(): Promise { const onExit = (code: number | null) => { cleanup(); if (code === 0) { - // Exited cleanly before signaling readiness rejectPromise(new Error('Background system exited before signaling readiness.')); } else { rejectPromise(new Error(`Background system exited unexpectedly (code ${code ?? 'unknown'})`)); @@ -195,6 +341,12 @@ export async function stopBackgroundSystem(timeoutMs = 10000): Promise<'stopped' return 'not_running'; } + try { + await sendDaemonRequest({ type: 'shutdown' }, Math.min(timeoutMs, 4000)); + } catch { + // If socket-based shutdown fails we will still signal with SIGTERM below. + } + try { process.kill(state.pid, 'SIGTERM'); } catch (error) { @@ -215,7 +367,6 @@ export async function stopBackgroundSystem(timeoutMs = 10000): Promise<'stopped' } } - // Attempt force kill try { process.kill(state.pid, 'SIGKILL'); } catch (error) { @@ -226,7 +377,12 @@ export async function stopBackgroundSystem(timeoutMs = 10000): Promise<'stopped' } removeState(); - return 'stopped'; + return 'timeout'; +} + +export async function restartBackgroundSystem(timeoutMs = 10000): Promise { + await stopBackgroundSystem(timeoutMs); + return startBackgroundSystem(); } function addTsNodeRegister(execArgv: string[]): string[] { @@ -239,12 +395,11 @@ function addTsNodeRegister(execArgv: string[]): string[] { } function filterExecArgv(execArgv: string[]): string[] { - // Remove debugging flags that would prevent daemonizing cleanly return execArgv.filter((arg) => !arg.startsWith('--inspect')); } /** - * Get the current interface mode from daemon state + * Get the current interface mode from daemon state. */ export function getInterfaceMode(): InterfaceMode { const state = readState(); @@ -252,7 +407,7 @@ export function getInterfaceMode(): InterfaceMode { } /** - * Get the current interface tier from daemon state + * Get the current interface tier from daemon state. */ export function getInterfaceTier(): InterfaceTier { const state = readState(); @@ -260,91 +415,212 @@ export function getInterfaceTier(): InterfaceTier { } /** - * Update the daemon state with new interface mode + * Update the daemon state with new interface mode. + * Used as a local-state fallback if socket messaging is unavailable. */ export function setInterfaceMode(mode: InterfaceMode): boolean { const state = readState(); if (!state) { return false; } - + writeState({ ...state, interfaceMode: mode }); - + return true; } /** - * Update the daemon state with new interface tier + * Update the daemon state with new interface tier. + * Used as a local-state fallback if socket messaging is unavailable. */ export function setInterfaceTier(tier: InterfaceTier): boolean { const state = readState(); if (!state) { return false; } - + writeState({ ...state, tier }); - + return true; } /** - * Update multiple daemon state properties at once + * Update multiple daemon state properties at once. */ export function updateDaemonState(updates: Partial>): boolean { const state = readState(); if (!state) { return false; } - + writeState({ ...state, ...updates }); - + return true; } +async function sendDaemonRequest( + request: Omit, + timeoutMs = 3000 +): Promise { + const status = getBackgroundStatus(); + if (!status.running || !status.pid) { + throw new Error('Background daemon is not running.'); + } + + const state = readState(); + const socketPath = getSocketPathFromState(state); + + return new Promise((resolvePromise, rejectPromise) => { + const id = randomUUID(); + const socket = createConnection(socketPath); + let settled = false; + let buffered = ''; + + const timer = setTimeout(() => { + if (settled) { + return; + } + settled = true; + socket.destroy(); + rejectPromise(new Error(`Daemon request timed out after ${timeoutMs}ms.`)); + }, timeoutMs); + + const cleanup = () => { + clearTimeout(timer); + socket.removeAllListeners(); + }; + + socket.once('error', (error) => { + if (settled) { + return; + } + settled = true; + cleanup(); + rejectPromise(error); + }); + + socket.on('data', (chunk: Buffer) => { + buffered += chunk.toString('utf8'); + const lines = buffered.split('\n'); + buffered = lines.pop() ?? ''; + + for (const line of lines) { + const trimmed = line.trim(); + if (!trimmed.length) { + continue; + } + + try { + const payload = JSON.parse(trimmed) as DaemonSocketResponse; + if (payload.id !== id) { + continue; + } + + if (settled) { + return; + } + settled = true; + cleanup(); + socket.end(); + resolvePromise(payload); + return; + } catch (error) { + if (settled) { + return; + } + settled = true; + cleanup(); + socket.destroy(); + rejectPromise(error as Error); + return; + } + } + }); + + socket.once('connect', () => { + const payload: DaemonSocketRequest = { + id, + type: request.type, + payload: request.payload + }; + socket.write(`${JSON.stringify(payload)}\n`); + }); + }); +} + /** - * Send an IPC message to the running daemon - * Returns false if daemon is not running or message fails to send + * Send a daemon command through the socket channel. */ export async function sendDaemonMessage(message: DaemonIPCMessage): Promise { const state = readState(); if (!state || !processAlive(state.pid)) { return false; } - - // Note: Direct IPC messaging requires a connected child process - // For now, we update state file which daemon can poll - // Future: implement proper IPC channel reconnection - - if (message.type === 'setMode') { - return setInterfaceMode(message.mode); - } - - if (message.type === 'setTier') { - return setInterfaceTier(message.tier); + + try { + if (message.type === 'setMode') { + const response = await sendDaemonRequest({ + type: 'setMode', + payload: { mode: message.mode } + }); + if (response.ok) { + updateDaemonState({ interfaceMode: message.mode }); + } + return response.ok; + } + + if (message.type === 'setTier') { + const response = await sendDaemonRequest({ + type: 'setTier', + payload: { tier: message.tier } + }); + if (response.ok) { + updateDaemonState({ tier: message.tier }); + } + return response.ok; + } + + if (message.type === 'shutdown') { + const response = await sendDaemonRequest({ type: 'shutdown' }); + return response.ok; + } + + if (message.type === 'getMode') { + const response = await sendDaemonRequest({ type: 'status' }); + return response.ok; + } + + return false; + } catch { + // Socket channel unavailable; use state file fallback where possible. + if (message.type === 'setMode') { + return setInterfaceMode(message.mode); + } + if (message.type === 'setTier') { + return setInterfaceTier(message.tier); + } + return false; } - - return false; } /** - * Request interface mode switch through the daemon - * This updates state and can trigger mode transition + * Request interface mode switch through the daemon. */ export async function requestModeSwitch( targetMode: InterfaceMode, options: { tier?: InterfaceTier } = {} ): Promise<{ success: boolean; currentMode: InterfaceMode; currentTier: InterfaceTier }> { const status = getBackgroundStatus(); - + if (!status.running) { return { success: false, @@ -352,17 +628,23 @@ export async function requestModeSwitch( currentTier: 'intermediate' }; } - - const updates: Partial> = { - interfaceMode: targetMode - }; - - if (options.tier) { - updates.tier = options.tier; + + let success = await sendDaemonMessage({ type: 'setMode', mode: targetMode }); + if (success && options.tier) { + success = await sendDaemonMessage({ type: 'setTier', tier: options.tier }); + } + + if (success) { + const snapshot = await queryBackgroundRuntimeSnapshot(2000); + if (snapshot) { + return { + success: true, + currentMode: snapshot.interfaceMode, + currentTier: snapshot.tier + }; + } } - - const success = updateDaemonState(updates); - + return { success, currentMode: success ? targetMode : (status.interfaceMode ?? 'cli'), diff --git a/src/cli/daemon-runner.ts b/src/cli/daemon-runner.ts index c1ab7b8..cb22dd1 100644 --- a/src/cli/daemon-runner.ts +++ b/src/cli/daemon-runner.ts @@ -1,13 +1,21 @@ +import { existsSync, mkdirSync, unlinkSync } from 'fs'; +import { writeFile } from 'fs/promises'; +import { join } from 'path'; +import { homedir } from 'os'; +import { createServer, type Server, type Socket } from 'net'; import { CodexSynapticSystem } from '../core/system.js'; import { Logger } from '../core/logger.js'; import { ConfigurationManager, InterfaceMode, InterfaceTier } from '../core/config.js'; -import type { DaemonIPCMessage } from './daemon-manager.js'; +import type { DaemonIPCMessage, DaemonRuntimeSnapshot } from './daemon-manager.js'; interface ReadyMessage { type: 'ready'; pid: number; interfaceMode: InterfaceMode; tier: InterfaceTier; + socketPath: string; + runtimePath: string; + logFile: string; } interface ErrorMessage { @@ -23,40 +31,297 @@ interface ModeChangedMessage { type DaemonMessage = ReadyMessage | ErrorMessage | ModeChangedMessage; +interface DaemonSocketRequest { + id: string; + type: 'status' | 'telemetry' | 'setMode' | 'setTier' | 'shutdown' | 'ping'; + payload?: Record; +} + +interface DaemonSocketResponse { + id: string; + ok: boolean; + result?: any; + error?: { + code: string; + message: string; + details?: Record; + }; +} + const logger = Logger.getInstance('daemon'); -/** - * Daemon state for interface mode tracking - */ interface DaemonState { currentMode: InterfaceMode; currentTier: InterfaceTier; } +interface TaskRecord { + id: string; + status: 'completed' | 'failed'; + summary?: string; + timestamp: string; +} + +const STATE_DIR = process.env.CODEX_SYNAPTIC_STATE_DIR || join(homedir(), '.codex-synaptic'); +const SOCKET_FILE = join(STATE_DIR, 'daemon.sock'); +const RUNTIME_FILE = join(STATE_DIR, 'daemon-runtime.json'); + +function ensureStateDir(): void { + if (!existsSync(STATE_DIR)) { + mkdirSync(STATE_DIR, { recursive: true }); + } +} + +function safeUnlink(path: string): void { + try { + if (existsSync(path)) { + unlinkSync(path); + } + } catch { + // ignore + } +} + async function main() { process.env.CODEX_SYNAPTIC_DAEMON_ACTIVE = '1'; + + ensureStateDir(); + safeUnlink(SOCKET_FILE); + + const startedAt = new Date().toISOString(); + const cwd = process.cwd(); + const logFile = join(cwd, 'logs', 'daemon.log'); + const system = new CodexSynapticSystem(); const configManager = new ConfigurationManager(); - - // Initialize daemon state from configuration + let socketServer: Server | undefined; + let runtimeTimer: NodeJS.Timeout | undefined; + const daemonState: DaemonState = { currentMode: 'cli', currentTier: 'intermediate' }; + const recentTasks: TaskRecord[] = []; + + const pushTask = (task: { id?: string; result?: any; error?: any; type?: string }, status: 'completed' | 'failed') => { + const record: TaskRecord = { + id: task.id ?? `task-${Date.now()}`, + status, + summary: status === 'completed' + ? (typeof task.result?.summary === 'string' ? task.result.summary : task.type) + : (typeof task.error === 'string' ? task.error : task.type), + timestamp: new Date().toISOString() + }; + recentTasks.unshift(record); + if (recentTasks.length > 20) { + recentTasks.splice(20); + } + }; + const notify = (message: DaemonMessage) => { if (typeof process.send === 'function') { process.send(message); } }; - /** - * Handle mode change request - */ + const buildSnapshot = (): DaemonRuntimeSnapshot => { + const status = system.getStatus(); + const registryStatus = system.getAgentRegistry().getStatus(); + return { + pid: process.pid, + startedAt, + updatedAt: new Date().toISOString(), + cwd, + interfaceMode: daemonState.currentMode, + tier: daemonState.currentTier, + status: { + initialized: Boolean(status?.initialized), + shuttingDown: Boolean(status?.shuttingDown), + daemon: true + }, + telemetry: { + agents: { + total: registryStatus.totalAgents, + available: registryStatus.availableAgents, + byType: { ...registryStatus.typeCounts }, + byStatus: { ...registryStatus.statusCounts } + }, + resources: system.getResourceManager().getCurrentUsage(), + mesh: system.getNeuralMesh().getStatus(), + swarm: system.getSwarmCoordinator().getStatus(), + consensus: system.getConsensusManager().getStatus(), + recentTasks: [...recentTasks] + } + }; + }; + + const persistSnapshot = async () => { + try { + const snapshot = buildSnapshot(); + await writeFile(RUNTIME_FILE, JSON.stringify(snapshot, null, 2), 'utf8'); + } catch (error) { + logger.debug('daemon', 'Failed to persist runtime snapshot', { + error: (error as Error).message + }); + } + }; + + const validateMode = (value: unknown): value is InterfaceMode => { + return value === 'cli' || value === 'tui' || value === 'gui'; + }; + + const validateTier = (value: unknown): value is InterfaceTier => { + return value === 'beginner' || value === 'intermediate' || value === 'advanced'; + }; + + const respond = (socket: Socket, payload: DaemonSocketResponse) => { + socket.write(`${JSON.stringify(payload)}\n`); + }; + + const handleSocketMessage = async (socket: Socket, request: DaemonSocketRequest): Promise => { + try { + switch (request.type) { + case 'ping': + respond(socket, { id: request.id, ok: true, result: { pid: process.pid } }); + return; + + case 'status': + respond(socket, { id: request.id, ok: true, result: buildSnapshot() }); + return; + + case 'telemetry': + respond(socket, { id: request.id, ok: true, result: buildSnapshot().telemetry }); + return; + + case 'setMode': { + const mode = request.payload?.mode; + if (!validateMode(mode)) { + respond(socket, { + id: request.id, + ok: false, + error: { + code: 'invalid_mode', + message: 'Mode must be one of cli|tui|gui.' + } + }); + return; + } + + daemonState.currentMode = mode; + notify({ type: 'modeChanged', mode: daemonState.currentMode, tier: daemonState.currentTier }); + void persistSnapshot().catch(err => logger.debug('daemon', 'Background persist failed', { error: err.message })); + respond(socket, { + id: request.id, + ok: true, + result: { mode: daemonState.currentMode, tier: daemonState.currentTier } + }); + return; + } + + case 'setTier': { + const tier = request.payload?.tier; + if (!validateTier(tier)) { + respond(socket, { + id: request.id, + ok: false, + error: { + code: 'invalid_tier', + message: 'Tier must be one of beginner|intermediate|advanced.' + } + }); + return; + } + + daemonState.currentTier = tier; + notify({ type: 'modeChanged', mode: daemonState.currentMode, tier: daemonState.currentTier }); + void persistSnapshot().catch(err => logger.debug('daemon', 'Background persist failed', { error: err.message })); + respond(socket, { + id: request.id, + ok: true, + result: { mode: daemonState.currentMode, tier: daemonState.currentTier } + }); + return; + } + + case 'shutdown': + respond(socket, { id: request.id, ok: true, result: { accepted: true } }); + setTimeout(() => { + void shutdown('socket-shutdown'); + }, 25); + return; + + default: + respond(socket, { + id: request.id, + ok: false, + error: { + code: 'unsupported_request', + message: `Unsupported request type: ${request.type}` + } + }); + } + } catch (error) { + respond(socket, { + id: request.id, + ok: false, + error: { + code: 'internal_error', + message: (error as Error).message + } + }); + } + }; + + const createSocketServer = async (): Promise => { + const server = createServer((socket) => { + let buffered = ''; + + socket.on('data', (chunk: Buffer) => { + buffered += chunk.toString('utf8'); + const lines = buffered.split('\n'); + buffered = lines.pop() ?? ''; + + for (const line of lines) { + const trimmed = line.trim(); + if (!trimmed.length) { + continue; + } + + try { + const request = JSON.parse(trimmed) as DaemonSocketRequest; + void handleSocketMessage(socket, request); + } catch (error) { + const badId = `bad-${Date.now()}`; + respond(socket, { + id: badId, + ok: false, + error: { + code: 'invalid_json', + message: (error as Error).message + } + }); + } + } + }); + }); + + await new Promise((resolvePromise, rejectPromise) => { + const onError = (error: Error) => rejectPromise(error); + server.once('error', onError); + server.listen(SOCKET_FILE, () => { + server.off('error', onError); + resolvePromise(); + }); + }); + + return server; + }; + const handleModeChange = async (targetMode: InterfaceMode, targetTier?: InterfaceTier) => { const previousMode = daemonState.currentMode; const previousTier = daemonState.currentTier; - + try { logger.info('daemon', 'Mode change requested', { from: previousMode, @@ -64,27 +329,25 @@ async function main() { tierFrom: previousTier, tierTo: targetTier ?? previousTier }); - - // Update daemon state + daemonState.currentMode = targetMode; if (targetTier) { daemonState.currentTier = targetTier; } - - // Notify parent process of mode change + notify({ type: 'modeChanged', mode: daemonState.currentMode, tier: daemonState.currentTier }); - + logger.info('daemon', 'Mode change completed', { mode: daemonState.currentMode, tier: daemonState.currentTier }); - + + await persistSnapshot(); } catch (error) { - // Rollback on failure daemonState.currentMode = previousMode; daemonState.currentTier = previousTier; logger.error('daemon', 'Mode change failed, rolled back', { @@ -95,30 +358,50 @@ async function main() { }; try { - // Load configuration to get initial interface settings await configManager.load(); const config = configManager.get(); - + if (config.interface) { daemonState.currentMode = config.interface.mode; daemonState.currentTier = config.interface.tui?.tier ?? config.interface.gui?.tier ?? 'intermediate'; } - + await system.initialize(); + + system.on('taskCompleted', (task: any) => pushTask(task, 'completed')); + system.on('taskFailed', (task: any) => pushTask(task, 'failed')); + + socketServer = await createSocketServer(); + + await persistSnapshot(); + runtimeTimer = setInterval(() => { + void persistSnapshot().catch(err => logger.debug('daemon', 'Periodic persist failed', { error: err.message })); + }, 1000); + if (typeof runtimeTimer.unref === 'function') { + runtimeTimer.unref(); + } + notify({ type: 'ready', pid: process.pid, interfaceMode: daemonState.currentMode, - tier: daemonState.currentTier + tier: daemonState.currentTier, + socketPath: SOCKET_FILE, + runtimePath: RUNTIME_FILE, + logFile }); + logger.info('daemon', 'Background Codex-Synaptic system initialized', { mode: daemonState.currentMode, - tier: daemonState.currentTier + tier: daemonState.currentTier, + socketPath: SOCKET_FILE, + runtimePath: RUNTIME_FILE }); } catch (error) { const err = error as Error; logger.error('daemon', 'Failed to initialize background system', undefined, err); notify({ type: 'error', error: err.message }); + safeUnlink(SOCKET_FILE); process.exit(1); return; } @@ -126,11 +409,23 @@ async function main() { const shutdown = async (reason: string) => { try { logger.info('daemon', 'Shutting down background system', { reason }); + if (runtimeTimer) { + clearInterval(runtimeTimer); + runtimeTimer = undefined; + } + if (socketServer) { + await new Promise((resolvePromise) => { + socketServer?.close(() => resolvePromise()); + }); + socketServer = undefined; + } + await persistSnapshot(); await system.shutdown(); logger.info('daemon', 'Background system shutdown complete'); } catch (error) { logger.error('daemon', 'Error during background shutdown', { reason }, error as Error); } finally { + safeUnlink(SOCKET_FILE); process.exit(0); } }; @@ -143,23 +438,27 @@ async function main() { void shutdown('sigint'); }); + process.on('exit', () => { + safeUnlink(SOCKET_FILE); + }); + process.on('message', (message: unknown) => { const msg = message as DaemonIPCMessage | null; if (!msg) return; - + switch (msg.type) { case 'shutdown': void shutdown('message'); break; - + case 'setMode': void handleModeChange(msg.mode); break; - + case 'setTier': void handleModeChange(daemonState.currentMode, msg.tier); break; - + case 'getMode': notify({ type: 'modeChanged', diff --git a/src/cli/doctor-helpers.ts b/src/cli/doctor-helpers.ts new file mode 100644 index 0000000..f9ce9ff --- /dev/null +++ b/src/cli/doctor-helpers.ts @@ -0,0 +1,115 @@ +/** + * Helper functions for doctor command + * Extracted to reduce complexity in main CLI handler + */ + +import { existsSync } from 'node:fs'; +import { join } from 'node:path'; +import { spawnSync } from 'node:child_process'; +import chalk from 'chalk'; + +export interface HealthCheck { + id: string; + ok: boolean; + details: string; + remediation?: string; + metadata?: Record; +} + +/** + * Check if CLI build artifact exists + */ +export function checkCliBuildArtifact(): HealthCheck { + const distCliPath = join(process.cwd(), 'dist', 'cli', 'index.js'); + const distExists = existsSync(distCliPath); + + return { + id: 'repo.cli_build_artifact', + ok: distExists, + details: distExists ? `Found ${distCliPath}` : `Missing ${distCliPath}`, + remediation: distExists ? undefined : 'Run `npm run build`.' + }; +} + +/** + * Check if CLI can execute + */ +export function checkCliExecution(distCliPath: string): HealthCheck | null { + if (!existsSync(distCliPath)) { + return null; + } + + const cliHelp = spawnSync('node', [distCliPath, '--help'], { + cwd: process.cwd(), + encoding: 'utf8' + }); + + return { + id: 'repo.cli_exec', + ok: cliHelp.status === 0, + details: cliHelp.status === 0 + ? 'CLI help command succeeded.' + : (cliHelp.stderr?.trim() || 'CLI help command failed.'), + remediation: cliHelp.status === 0 + ? undefined + : 'Run `npm run build` and re-run `node dist/cli/index.js --help`.' + }; +} + +/** + * Check Codex authentication status + */ +export function checkCodexAuth(): HealthCheck { + const loginStatus = spawnSync('codex', ['login', 'status'], { + cwd: process.cwd(), + encoding: 'utf8' + }); + + const stdout = loginStatus.stdout?.trim() || ''; + const stderr = loginStatus.stderr?.trim() || ''; + const ok = loginStatus.status === 0 && !/not logged in/i.test(stdout); + + return { + id: 'codex.auth', + ok, + details: ok + ? 'Codex is authenticated.' + : (stdout || stderr || 'No output'), + remediation: ok ? undefined : 'Run `codex login` then re-run `codex login status`.' + }; +} + +/** + * Render health check results + */ +export function renderHealthCheckResults( + checks: HealthCheck[], + options: { json?: boolean; strict?: boolean } +): void { + const passed = checks.filter((check) => check.ok).length; + const failed = checks.length - passed; + + if (options.json) { + console.log(JSON.stringify({ + ok: failed === 0, + summary: { passed, failed, total: checks.length }, + checks + }, null, 2)); + } else { + console.log(chalk.blue('🩺 Codex-Synaptic Doctor')); + console.log(chalk.gray(` Passed: ${passed}`)); + console.log(chalk.gray(` Failed: ${failed}`)); + + checks.forEach((check) => { + const marker = check.ok ? chalk.green('✓') : chalk.red('✗'); + console.log(`${marker} ${check.id}: ${check.details}`); + if (!check.ok && check.remediation) { + console.log(chalk.yellow(` remediation: ${check.remediation}`)); + } + }); + } + + if (options.strict && failed > 0) { + throw new Error(`Doctor found ${failed} failing check(s).`); + } +} diff --git a/src/cli/hive-mind-helpers.ts b/src/cli/hive-mind-helpers.ts new file mode 100644 index 0000000..515aec2 --- /dev/null +++ b/src/cli/hive-mind-helpers.ts @@ -0,0 +1,318 @@ +/** + * Helper functions for hive-mind spawn command + * Extracted to reduce complexity in main CLI handler + */ + +import chalk from 'chalk'; +import type { CodexSynapticSystem } from '../core/system.js'; +import type { + CodexContext +} from '../types/codex-context.js'; + +/** + * Execution result data structure + */ +export interface ExecutionResultData { + executionId: string; + status: string; + duration: number; + originalPrompt: string; + summary?: string; + artifacts: Record; + stages: any[]; + agentCount: number; + taskCount: number; + meshStatus: { + nodeCount: number; + connectionCount: number; + }; + consensusStatus: { + performed: boolean; + proposalId?: string; + accepted?: boolean; + votes?: any; + timedOut?: boolean; + error?: string; + }; + swarmStatus: { + algorithm: string; + isOptimizing: boolean; + }; + totPlan?: any; + codexContext: { + enabled: boolean; + contextHash?: string; + sizeBytes?: number; + }; +} + +/** + * Execute GOAP workflow + */ +export async function executeGoapWorkflow( + system: CodexSynapticSystem, + manifest: any, + goalId: string, + originalPrompt: string, + dryRun: boolean +): Promise { + console.log( + chalk.blue( + `🧭 Executing GOAP profile ${manifest.metadata?.name ?? manifest.id} (goal: ${goalId})` + ) + ); + + const { GoapExecutor } = await import('../reasoning/goap/executor.js'); + const executor = new GoapExecutor(system); + const result = await executor.execute(manifest, { + goalId, + prompt: originalPrompt, + dryRun + }); + + console.log( + chalk.green( + `✅ GOAP workflow complete — ${result.actionsCompleted}/${result.totalActions} actions executed.` + ) + ); + + if (result.artifacts.length) { + console.log(chalk.cyan('📦 Generated artifacts:')); + for (const artifact of result.artifacts) { + console.log(chalk.gray(` • ${artifact}`)); + } + } +} + +/** + * Execute task with timeout and consensus + * @param system - The Codex Synaptic system instance + * @param prompt - The task prompt to execute + * @param originalPrompt - The original user prompt before enrichment + * @param config - The hive-mind configuration + * @param startTime - The execution start timestamp + * @param shouldRequireConsensus - Function to check if consensus is needed + * @param orchestrateConsensus - Function to orchestrate consensus voting + * @returns Object containing outcome, consensusResult, and totalTime + */ +export async function executeTaskWithConsensus( + system: CodexSynapticSystem, + prompt: string, + originalPrompt: string, + config: any, + startTime: number, + shouldRequireConsensus: (prompt: string, consensusMode: string) => boolean, + orchestrateConsensus: ( + system: CodexSynapticSystem, + prompt: string, + outcome: any, + consensusMode: string + ) => Promise +): Promise<{ outcome: any; consensusResult: any; totalTime: number }> { + const outcome: any = await Promise.race([ + system.executeTask(prompt), + new Promise((_, reject) => + setTimeout(() => reject(new Error('Hive-mind execution timeout')), config.timeout) + ) + ]); + + let consensusResult: any = { performed: false }; + + const consensusNeeded = shouldRequireConsensus(originalPrompt, config.consensus); + + if (consensusNeeded) { + consensusResult = await orchestrateConsensus( + system, + originalPrompt, + outcome, + config.consensus + ); + } + + const totalTime = Date.now() - startTime; + return { outcome, consensusResult, totalTime }; +} + +/** + * Collect and format execution results + * @param outcome - The task execution outcome + * @param consensusResult - The consensus voting result + * @param totalTime - Total execution time in milliseconds + * @param originalPrompt - The original user prompt + * @param system - The Codex Synaptic system instance + * @param codexContext - Optional Codex context if enabled + * @returns Structured execution result data + */ +export function collectExecutionResults( + outcome: any, + consensusResult: any, + totalTime: number, + originalPrompt: string, + system: CodexSynapticSystem, + codexContext?: CodexContext +): ExecutionResultData { + const swarmStatus = system.getSwarmCoordinator().getStatus(); + const meshStatus = system.getNeuralMesh().getStatus(); + const agentRegistry = system.getAgentRegistry().getStatus(); + + const reactPlanArtifact = outcome.artifacts?.reactPlan ?? null; + const totPlan = reactPlanArtifact?.tot ?? null; + + return { + executionId: `exec-${Date.now()}`, + status: 'completed', + duration: totalTime, + originalPrompt, + summary: outcome.summary, + artifacts: outcome.artifacts || {}, + stages: outcome.stages || [], + agentCount: agentRegistry.totalAgents, + taskCount: outcome.stages?.length || 0, + meshStatus: { + nodeCount: meshStatus.nodeCount, + connectionCount: meshStatus.connectionCount + }, + consensusStatus: { + performed: consensusResult.performed, + proposalId: consensusResult.proposalId, + accepted: consensusResult.accepted, + votes: consensusResult.votes, + timedOut: consensusResult.timedOut, + error: consensusResult.error + }, + swarmStatus: { + algorithm: swarmStatus.algorithm, + isOptimizing: swarmStatus.isOptimizing + }, + totPlan, + codexContext: codexContext ? { + enabled: true, + contextHash: codexContext.contextHash, + sizeBytes: codexContext.sizeBytes + } : { enabled: false } + }; +} + +/** + * Render execution summary + * @param resultData - Structured execution result data + * @param options - Rendering options (yaml and debug flags) + */ +export async function renderExecutionSummary( + resultData: ExecutionResultData, + options: { yaml?: boolean; debug?: boolean } +): Promise { + console.log(chalk.green(`\n🎉 Hive-mind execution completed in ${resultData.duration}ms`)); + + if (options.yaml) { + const { HiveMindYamlFormatter } = await import('../utils/yaml-output.js'); + console.log(chalk.blue('\n📋 Results (YAML format):')); + console.log(HiveMindYamlFormatter.formatExecutionResult(resultData)); + return; + } + + if (resultData.consensusStatus.performed) { + const statusIcon = resultData.consensusStatus.accepted ? '✅' : '❌'; + console.log( + chalk.cyan( + `\n🗳️ Consensus ${statusIcon} (${resultData.consensusStatus.votes?.for ?? 0} for, ${resultData.consensusStatus.votes?.against ?? 0} against)` + ) + ); + } + + if (resultData.summary) { + console.log(chalk.white(`\n${resultData.summary}`)); + } + + if (resultData.artifacts && Object.keys(resultData.artifacts).length > 0) { + console.log(chalk.cyan('\n📦 Generated Artifacts:')); + for (const [key, artifact] of Object.entries(resultData.artifacts)) { + if (artifact && typeof artifact === 'object' && 'summary' in artifact) { + console.log(chalk.gray(` ${key}: ${(artifact as any).summary}`)); + } else { + console.log(chalk.gray(` ${key}`)); + } + } + } + + if (resultData.totPlan) { + const plan = resultData.totPlan; + console.log(chalk.blue('\n🌳 Tree-of-Thought Plan:')); + if (plan.bestBranch?.reasoning) { + console.log(chalk.white(` Reasoning: ${plan.bestBranch.reasoning}`)); + } + if (plan.branches && Array.isArray(plan.branches)) { + console.log(chalk.gray(` Evaluated ${plan.branches.length} branches`)); + } + if (plan.knowledgeUpdates && Array.isArray(plan.knowledgeUpdates)) { + console.log(chalk.gray(' Knowledge Updates:')); + plan.knowledgeUpdates.slice(0, 5).forEach((item: string, idx: number) => { + console.log(chalk.gray(` ${idx + 1}. ${item}`)); + }); + } + } + + if (resultData.stages && Array.isArray(resultData.stages)) { + console.log(chalk.blue('\n🔄 Stage Results:')); + resultData.stages.forEach((stage: any, idx: number) => { + console.log(chalk.cyan(` ${idx + 1}. ${stage.stage} (${stage.taskId})`)); + if (stage.result?.summary) { + console.log(chalk.gray(` ${stage.result.summary}`)); + } + }); + } + + console.log(chalk.blue('\n📈 System Metrics:')); + console.log(chalk.white(` Agents: ${resultData.agentCount} active`)); + console.log( + chalk.white( + ` Mesh: ${resultData.meshStatus.nodeCount} nodes, ${resultData.meshStatus.connectionCount} connections` + ) + ); + console.log( + chalk.white( + ` Swarm: ${resultData.swarmStatus.algorithm}, optimizing=${resultData.swarmStatus.isOptimizing}` + ) + ); + console.log(chalk.white(` Execution time: ${resultData.duration}ms`)); + + if (!options.debug && !options.yaml) { + console.log(chalk.blue('\n💾 Results saved to session telemetry')); + } else if (options.debug && !options.yaml) { + console.log(chalk.blue('\n🔍 Full Debug Output:')); + console.log(JSON.stringify(resultData, null, 2)); + } +} + +/** + * Setup workflow event handlers + */ +export function setupWorkflowEventHandlers( + system: CodexSynapticSystem, + startTime: number +): { cleanup: () => void } { + const onStageStarted = (event: any) => { + console.log(chalk.gray(` ▶ ${event.label} started (${event.taskType})`)); + }; + + const onStageCompleted = (event: any) => { + const elapsed = Date.now() - startTime; + console.log(chalk.green(` ✓ ${event.label} completed (+${elapsed}ms)`)); + }; + + const onStageFailed = (event: any) => { + console.log(chalk.red(` ✗ ${event.label} failed: ${event.error}`)); + }; + + system.on('workflowStageStarted', onStageStarted); + system.on('workflowStageCompleted', onStageCompleted); + system.on('workflowStageFailed', onStageFailed); + + return { + cleanup: () => { + system.off('workflowStageStarted', onStageStarted); + system.off('workflowStageCompleted', onStageCompleted); + system.off('workflowStageFailed', onStageFailed); + } + }; +} diff --git a/src/cli/index.ts b/src/cli/index.ts index f38f8c1..d87fa0a 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -14,6 +14,9 @@ import { AgentType, AgentMetadata } from '../core/types.js'; import { type BackgroundStatus, getBackgroundStatus, + getBackgroundRuntimeSnapshot, + queryBackgroundRuntimeSnapshot, + restartBackgroundSystem, startBackgroundSystem, stopBackgroundSystem } from './daemon-manager.js'; @@ -29,19 +32,21 @@ import type { CodexPromptEnvelope, ContextLogEntry } from '../types/codex-context.js'; -import { RetryManager } from '../core/errors.js'; +import { RetryManager, DaemonConflictError } from '../core/errors.js'; import { HiveMindYamlFormatter } from '../utils/yaml-output.js'; import { parseFileContent, parseJsonInput, loadFileThroughFeedforward } from './feedforward.js'; import { InstructionParser } from '../instructions/index.js'; import { RoutingPolicyService, type RoutingRequest } from '../router/index.js'; import { readFileSync, existsSync } from 'fs'; import { join, resolve, relative } from 'path'; +import { spawnSync, execFile } from 'child_process'; +import { promisify } from 'util'; import { ToolOptimizer, type ToolCandidate } from '../tools/optimizer/index.js'; import { type ToolUsageRecord, type ReasoningRunRecord } from '../memory/memory-system.js'; import type { ReasoningPlanOptions, ReasoningCompletionOptions, ReasoningCheckpointInput } from '../reasoning/planner.js'; -import { GoapExecutor } from '../reasoning/goap/executor.js'; import { goapRegistry } from '../reasoning/goap/registry.js'; -import type { SystemConfiguration } from '../core/config.js'; +import { GoapExecutor } from '../reasoning/goap/executor.js'; +import type { InterfaceMode, InterfaceTier, SystemConfiguration } from '../core/config.js'; import { serviceManager } from '../env/service-manager.js'; import { executeStrategy, @@ -64,12 +69,27 @@ import { formatRecentTasks, type TelemetrySnapshot } from './telemetry-renderer.js'; +import { startTui, type TuiRuntimeSnapshot } from '../tui/index.js'; import { executeOrchestrationPhases } from './hive-mind-orchestrator.js'; import { validateQuotaOptions, buildPolicyInput, type QuotaOptions } from './tenant-quota-helpers.js'; +import { + executeGoapWorkflow, + executeTaskWithConsensus, + collectExecutionResults, + renderExecutionSummary, + setupWorkflowEventHandlers +} from './hive-mind-helpers.js'; +import { + checkCliBuildArtifact, + checkCliExecution, + checkCodexAuth, + renderHealthCheckResults, + type HealthCheck +} from './doctor-helpers.js'; /** * Loads environment variables from a file into process.env. @@ -771,6 +791,21 @@ async function useSystem( ): Promise { bootstrapEnvForCli(); const alreadyRunning = !!session.getSystemUnsafe(); + if (!alreadyRunning && process.env.CODEX_ALLOW_LOCAL_WITH_DAEMON !== '1') { + const background = getBackgroundStatus(); + if (background.running) { + throw new DaemonConflictError( + `Background daemon already running (pid ${background.pid}). ` + + 'To avoid split-brain state, use `codex-synaptic background attach` for daemon-backed monitoring, ' + + '`codex-synaptic background stop` before local commands, or set CODEX_ALLOW_LOCAL_WITH_DAEMON=1 to override.', + { + daemonPid: background.pid, + alreadyRunning, + allowLocalWithDaemon: process.env.CODEX_ALLOW_LOCAL_WITH_DAEMON + } + ); + } + } const autoShutdown = options.autoShutdown ?? cliAutoShutdown; if (!alreadyRunning && !cliSilent) { console.log(chalk.blue(`🔧 Initializing Codex-Synaptic system (${description})...`)); @@ -2009,47 +2044,74 @@ function renderConsensusStatus(system: CodexSynapticSystem): void { } /** - * Renders telemetry snapshot to the console including agents, resources, and recent tasks. + * Renders telemetry snapshot to the console with customizable title. + * + * @param snapshot - The telemetry snapshot to render + * @param title - Optional title for the snapshot display * * @remarks - * Retrieves the latest telemetry from the global session and displays: + * Displays: * - Agent statistics (status, types, resource usage) * - Resource metrics (CPU, memory, GPU) + * - Mesh, swarm, and consensus statistics * - Recent task summaries - * Shows "No telemetry available" if no snapshot exists. */ -function renderTelemetry(): void { - const snapshot = session.getTelemetry() as TelemetrySnapshot; - console.log(chalk.blue('📊 Telemetry Snapshot')); +function renderTelemetrySnapshot(snapshot: TelemetrySnapshot, title = '📊 Telemetry Snapshot'): void { + console.log(chalk.blue(title)); - // Render agent stats formatAgentStats(snapshot.agents).forEach((line) => console.log(line)); - - // Render resource stats formatResourceStats(snapshot.resources).forEach((line) => console.log(line)); - - // Render mesh stats const meshStats = formatMeshStats(snapshot.mesh); if (meshStats) { console.log(meshStats); } - - // Render swarm stats const swarmStats = formatSwarmStats(snapshot.swarm); if (swarmStats) { console.log(swarmStats); } - - // Render consensus stats const consensusStats = formatConsensusStats(snapshot.consensus); if (consensusStats) { console.log(consensusStats); } - - // Render recent tasks formatRecentTasks(snapshot.recentTasks).forEach((line) => console.log(line)); } +/** + * Renders telemetry snapshot to the console including agents, resources, and recent tasks. + * + * @remarks + * Retrieves the latest telemetry from the global session and displays: + * - Agent statistics (status, types, resource usage) + * - Resource metrics (CPU, memory, GPU) + * - Recent task summaries + * Shows "No telemetry available" if no snapshot exists. + */ +function renderTelemetry(): void { + const snapshot = session.getTelemetry() as TelemetrySnapshot; + renderTelemetrySnapshot(snapshot); +} + +function renderDaemonSnapshot(snapshot: { + pid: number; + startedAt: string; + updatedAt: string; + cwd: string; + interfaceMode: InterfaceMode; + tier: InterfaceTier; + status: { initialized: boolean; shuttingDown: boolean; daemon: boolean }; + telemetry: TelemetrySnapshot; +}): void { + console.log(chalk.blue('🛰 Daemon Runtime Snapshot')); + console.log(` PID: ${snapshot.pid}`); + console.log(` Started at: ${snapshot.startedAt}`); + console.log(` Updated at: ${snapshot.updatedAt}`); + console.log(` Working directory: ${snapshot.cwd}`); + console.log(` Interface: ${snapshot.interfaceMode}/${snapshot.tier}`); + console.log(` Initialized: ${snapshot.status.initialized ? chalk.green('yes') : chalk.red('no')}`); + console.log(` Shutting down: ${snapshot.status.shuttingDown ? chalk.yellow('yes') : chalk.green('no')}`); + renderTelemetrySnapshot(snapshot.telemetry, '📊 Daemon Telemetry'); +} + /** * Emits context aggregation logs to the console. * @@ -2405,42 +2467,6 @@ async function executeGoapStrategy( } } -/** - * Sets up workflow event handlers for stage tracking. - * - * @param system - Codex-Synaptic system instance - * @param startTime - Workflow start timestamp for elapsed time calculation - * @returns Cleanup function to remove event handlers - * - * @remarks - * Attaches handlers for workflowStageStarted, workflowStageCompleted, and workflowStageFailed events. - */ -function setupWorkflowEventHandlers( - system: CodexSynapticSystem, - startTime: number -): () => void { - const onStageStarted = (event: any) => { - console.log(chalk.gray(` ▶ ${event.label} started (${event.taskType})`)); - }; - const onStageCompleted = (event: any) => { - const elapsed = Date.now() - startTime; - console.log(chalk.green(` ✓ ${event.label} completed (+${elapsed}ms)`)); - }; - const onStageFailed = (event: any) => { - console.log(chalk.red(` ✗ ${event.label} failed: ${event.error}`)); - }; - - system.on('workflowStageStarted', onStageStarted); - system.on('workflowStageCompleted', onStageCompleted); - system.on('workflowStageFailed', onStageFailed); - - return () => { - system.off('workflowStageStarted', onStageStarted); - system.off('workflowStageCompleted', onStageCompleted); - system.off('workflowStageFailed', onStageFailed); - }; -} - /** * Displays hive-mind execution results in human-readable format. * @@ -2671,7 +2697,7 @@ async function executeClassicOrchestration( console.log(JSON.stringify(outcome, null, 2)); } } finally { - cleanupEventHandlers(); + cleanupEventHandlers.cleanup(); } } @@ -2707,7 +2733,17 @@ const systemCmd = decorateCommandHelp( systemCmd .command('start') .description('Start the Codex-Synaptic system (idempotent)') - .action(handleCommand('system.start', async () => { + .option('--daemon', 'Start the detached daemon instead of in-process system session') + .action(handleCommand('system.start', async (options) => { + if (options.daemon) { + const status = await startBackgroundSystem(); + console.log(chalk.green(`✅ Background system running (pid ${status.pid})`)); + if (status.startedAt) { + console.log(` Started at: ${status.startedAt}`); + } + return; + } + if (session.getSystemUnsafe()) { console.log(chalk.yellow('⚠️ Codex-Synaptic system already running.')); renderTelemetry(); @@ -2754,13 +2790,26 @@ systemCmd .command('stop') .description('Stop the Codex-Synaptic system and release resources') .action(handleCommand('system.stop', async () => { - if (!session.getSystemUnsafe()) { - console.log(chalk.gray('System already stopped.')); + if (session.getSystemUnsafe()) { + await session.shutdown('manual-stop'); + console.log(chalk.green('✅ Codex-Synaptic system shutdown complete.')); return; } - await session.shutdown('manual-stop'); - console.log(chalk.green('✅ Codex-Synaptic system shutdown complete.')); + const background = getBackgroundStatus(); + if (background.running) { + const result = await stopBackgroundSystem(); + if (result === 'stopped') { + console.log(chalk.green('✅ Background system stopped.')); + } else if (result === 'timeout') { + console.log(chalk.yellow('⚠️ Background system stop timed out and required force termination.')); + } else { + console.log(chalk.gray('Background system was not running.')); + } + return; + } + + console.log(chalk.gray('System already stopped.')); })); systemCmd @@ -2768,9 +2817,48 @@ systemCmd .description('Stream live telemetry until interrupted') .option('-i, --interval ', 'Refresh interval in milliseconds', '2000') .action(handleCommand('system.monitor', async (options) => { + const intervalMs = parseInteger(options.interval, 'interval'); + console.log(chalk.blue('📡 Streaming telemetry (Ctrl+C to stop)...')); + + const localSystem = session.getSystemUnsafe(); + const background = getBackgroundStatus(); + + if (!localSystem && background.running) { + const render = async () => { + console.log('\n' + chalk.gray('─'.repeat(40))); + const snapshot = await queryBackgroundRuntimeSnapshot(); + if (!snapshot) { + console.log(chalk.yellow('Daemon snapshot unavailable.')); + return; + } + renderDaemonSnapshot({ + ...snapshot, + telemetry: snapshot.telemetry as TelemetrySnapshot + }); + }; + + await render(); + const timer = setInterval(() => { + void render(); + }, intervalMs); + + const stop = () => clearInterval(timer); + process.once('SIGINT', stop); + process.once('SIGTERM', stop); + await new Promise((resolve) => { + const cleanup = () => { + process.removeListener('SIGINT', stop); + process.removeListener('SIGTERM', stop); + stop(); + resolve(); + }; + process.once('SIGINT', cleanup); + process.once('SIGTERM', cleanup); + }); + return; + } + await useSystem('system monitor', async () => { - const intervalMs = parseInteger(options.interval, 'interval'); - console.log(chalk.blue('📡 Streaming telemetry (Ctrl+C to stop)...')); const render = () => { console.log('\n' + chalk.gray('─'.repeat(40))); renderTelemetry(); @@ -2963,6 +3051,58 @@ backgroundCmd } })); +backgroundCmd + .command('attach') + .description('Attach to daemon-backed telemetry without creating a second orchestrator') + .option('-w, --watch', 'Continuously stream daemon status until interrupted') + .option('-i, --interval ', 'Refresh interval in milliseconds when using --watch', '2000') + .action(handleCommand('background.attach', async (options) => { + const status = getBackgroundStatus(); + if (!status.running) { + console.log(chalk.yellow('⚠️ Background system is not running. Start it with `codex-synaptic background start`.')); + return; + } + + const render = async () => { + const snapshot = await queryBackgroundRuntimeSnapshot(); + if (!snapshot) { + console.log(chalk.yellow('Daemon snapshot unavailable.')); + return; + } + renderDaemonSnapshot({ + ...snapshot, + telemetry: snapshot.telemetry as TelemetrySnapshot + }); + }; + + if (!options.watch) { + await render(); + return; + } + + const intervalMs = parseInteger(options.interval, 'interval'); + console.log(chalk.blue('📡 Attached to background daemon telemetry (Ctrl+C to stop)...')); + await render(); + const timer = setInterval(() => { + console.log('\n' + chalk.gray('─'.repeat(40))); + void render(); + }, intervalMs); + + const stop = () => clearInterval(timer); + process.once('SIGINT', stop); + process.once('SIGTERM', stop); + await new Promise((resolve) => { + const cleanup = () => { + process.removeListener('SIGINT', stop); + process.removeListener('SIGTERM', stop); + stop(); + resolve(); + }; + process.once('SIGINT', cleanup); + process.once('SIGTERM', cleanup); + }); + })); + backgroundCmd .command('stop') .description('Terminate the detached background system') @@ -2978,11 +3118,56 @@ backgroundCmd console.log(chalk.gray('Background system was not running.')); break; case 'timeout': - console.log(chalk.yellow('⚠️ Background system did not stop before timeout.')); + console.log(chalk.yellow('⚠️ Background system did not stop before timeout and was force terminated.')); break; } })); +backgroundCmd + .command('restart') + .description('Restart the detached background system') + .option('-t, --timeout ', 'Timeout before force stopping', '10000') + .action(handleCommand('background.restart', async (options) => { + const timeout = parseInteger(options.timeout, 'timeout'); + const status = await restartBackgroundSystem(timeout); + console.log(chalk.green(`✅ Background system running (pid ${status.pid})`)); + if (status.startedAt) { + console.log(` Started at: ${status.startedAt}`); + } + })); + +backgroundCmd + .command('logs') + .description('Show daemon log output') + .option('--tail ', 'Number of log lines to display', '50') + .action(handleCommand('background.logs', async (options) => { + const tailLines = parseInteger(options.tail, 'tail'); + const status = getBackgroundStatus(); + const runtime = getBackgroundRuntimeSnapshot(); + + const logPath = status.logFile + ?? (status.cwd ? join(status.cwd, 'logs', 'daemon.log') : join(process.cwd(), 'logs', 'daemon.log')); + + if (!existsSync(logPath)) { + console.log(chalk.yellow(`⚠️ Log file not found: ${logPath}`)); + if (!status.running) { + console.log(chalk.gray('Background daemon is not running.')); + } + return; + } + + const content = readFileSync(logPath, 'utf8'); + const lines = content.split(/\\r?\\n/).filter((line) => line.length > 0); + const selected = lines.slice(-Math.max(1, tailLines)); + + console.log(chalk.blue(`📜 Daemon logs (${selected.length}/${lines.length})`)); + console.log(chalk.gray(` File: ${logPath}`)); + if (runtime?.updatedAt) { + console.log(chalk.gray(` Last daemon update: ${runtime.updatedAt}`)); + } + selected.forEach((line) => console.log(line)); + })); + // Instructions commands const instructionsCmd = decorateCommandHelp( program @@ -4251,6 +4436,10 @@ bridgeCmd await useSystem('mcp send', async (system) => { const payload = parseJsonInput(options.payload, 'payload'); const response = await system.sendMcpMessage(options.endpoint, payload); + if (!response?.ok) { + const details = response?.error ? JSON.stringify(response.error) : 'unknown MCP bridge failure'; + throw new Error(`MCP bridge request failed: ${details}`); + } console.log(chalk.green('✅ MCP message delivered. Response:')); console.log(JSON.stringify(response, null, 2)); }); @@ -4866,22 +5055,34 @@ envCmd console.log(chalk.cyan(` ${name}`)); console.log(chalk.gray(` ${profile.description}`)); console.log(chalk.gray(` compose: ${profile.composeFile}`)); + if (profile.port) { + console.log(chalk.gray(` port: ${profile.port}`)); + } + if (profile.requiredEnv?.length) { + console.log(chalk.gray(` required env: ${profile.requiredEnv.join(', ')}`)); + } }); }); envCmd .command('status') .description('Show status for a service profile') - .argument('[name]', 'Service profile name') - .action((name?: string) => { - const targets = name ? [name] : serviceManager.listProfiles().map(({ name }) => name); - targets.forEach((target) => { - const status = serviceManager.status(target); - console.log(chalk.cyan(` -${status.name}`)); + .argument('[names...]', 'Service profile name(s)') + .action(async (names?: string[]) => { + const targets = names && names.length ? names : serviceManager.listProfiles().map(({ name }) => name); + for (const target of targets) { + const status = await serviceManager.status(target); + console.log(chalk.cyan(`\n${status.name}`)); console.log(chalk.gray(` running: ${status.running ? 'yes' : 'no'}`)); + console.log(chalk.gray(` healthy: ${status.healthy === null ? 'n/a' : (status.healthy ? 'yes' : 'no')}`)); + console.log(chalk.gray(` checkedAt: ${status.checkedAt}`)); + if (status.diagnostics.length) { + status.diagnostics.forEach((diagnostic) => { + console.log(chalk.yellow(` diag: ${diagnostic}`)); + }); + } console.log(chalk.gray(status.raw.trim())); - }); + } }); envCmd @@ -4889,12 +5090,18 @@ envCmd .description('Start one or more service profiles') .argument('', 'Service profile names') .option('--no-wait', 'Do not wait for health checks') - .action(async (names: string[], options) => { + .option('--filesystem-mode ', 'Filesystem profile mode: read-only or controlled-write', 'read-only') + .option('--allow-filesystem-write', 'Allow controlled-write filesystem profile mode') + .action(handleCommand('env.up', async (names: string[], options) => { for (const name of names) { - await serviceManager.ensureService(name, { waitForHealth: options.wait !== false }); + await serviceManager.ensureService(name, { + waitForHealth: options.wait !== false, + filesystemMode: options.filesystemMode, + allowFilesystemWrite: options.allowFilesystemWrite === true + }); console.log(chalk.green(`✅ ${name} started`)); } - }); + })); envCmd .command('down') @@ -4921,9 +5128,215 @@ ${name}`)); if (profile.services && profile.services.length) { console.log(chalk.gray(` services: ${profile.services.join(', ')}`)); } + if (profile.port) { + console.log(chalk.gray(` port: ${profile.port}`)); + } + if (profile.codexName) { + console.log(chalk.gray(` codex mcp name: ${profile.codexName}`)); + } + if (profile.requiredEnv?.length) { + console.log(chalk.gray(` required env: ${profile.requiredEnv.join(', ')}`)); + } + if (name === 'mcp-filesystem') { + console.log(chalk.gray(' filesystem mode: read-only (default) or controlled-write with explicit approval')); + } }); }); +const execFileAsync = promisify(execFile); + +/** + * Execute codex CLI command with timeout and error handling + */ +async function execCodexCommand(args: string[], timeoutMs = 10000): Promise<{ stdout: string; stderr: string; exitCode: number }> { + try { + const { stdout, stderr } = await execFileAsync('codex', args, { + cwd: process.cwd(), + encoding: 'utf8', + timeout: timeoutMs + }); + return { stdout, stderr, exitCode: 0 }; + } catch (error: unknown) { + const err = error as { code?: string | number; killed?: boolean; signal?: string; stdout?: string; stderr?: string }; + if (err.code === 'ENOENT') { + throw new Error('codex command not found. Ensure Codex CLI is installed and in PATH.'); + } + if (err.killed && err.signal === 'SIGTERM') { + throw new Error(`codex command timed out after ${timeoutMs}ms`); + } + return { + stdout: err.stdout || '', + stderr: err.stderr || '', + exitCode: typeof err.code === 'number' ? err.code : 1 + }; + } +} + +envCmd + .command('codex-register') + .description('Register MCP HTTP profiles in Codex CLI MCP config') + .argument('', 'Service profile names to register') + .option('--replace', 'Replace existing MCP registration if it already exists') + .action(handleCommand('env.codex-register', async (names: string[], options) => { + for (const name of names) { + const registration = serviceManager.codexRegistration(name); + if (!registration) { + throw new Error(`Profile ${name} does not expose codex registration metadata.`); + } + + if (options.replace) { + const remove = await execCodexCommand(['mcp', 'remove', registration.codexName]); + if (remove.exitCode === 0) { + console.log(chalk.gray(`Removed existing Codex MCP entry: ${registration.codexName}`)); + } + } + + const add = await execCodexCommand(['mcp', 'add', registration.codexName, '--url', registration.url]); + + if (add.exitCode !== 0) { + const stderr = add.stderr?.trim(); + if (stderr?.includes('already exists')) { + console.log(chalk.yellow(`⚠️ Codex MCP entry already exists: ${registration.codexName}`)); + continue; + } + throw new Error(`codex mcp add failed for ${registration.codexName}: ${stderr || add.stdout || 'unknown error'}`); + } + + console.log(chalk.green(`✅ Registered Codex MCP server ${registration.codexName} -> ${registration.url}`)); + } + })); + +const doctorCmd = decorateCommandHelp( + program + .command('doctor') + .description('Run bootstrap and integration diagnostics for Codex + MCP + repo CLI readiness'), + { + title: 'Doctor Console', + subtitle: 'Validate auth, MCP services, Codex registrations, and local CLI readiness in one pass.', + context: [ + 'Doctor catches setup drift before you launch long-running Codex or swarm sessions.', + 'Use this after pulling changes or rotating local MCP/server credentials.' + ], + skills: [ + 'Correlate MCP service health with Codex registration state.', + 'Generate concrete remediation commands when readiness checks fail.' + ], + vibeTips: [ + 'Run doctor before broad orchestration changes and keep the output in your release notes.' + ], + actions: [ + { command: 'codex-synaptic doctor', description: 'Run default readiness checks.' }, + { command: 'codex-synaptic doctor --strict', description: 'Exit non-zero if any readiness check fails.' } + ], + docs: [ + { label: 'docs/guides/codex-macos-workflows.md', description: 'macOS setup flow aligned with this doctor output.' } + ] + } +); + +doctorCmd + .option('--json', 'Output doctor report as JSON') + .option('--strict', 'Exit with an error when any check fails') + .option('--skip-codex-auth', 'Skip codex login status check') + .option( + '--mcp-profiles ', + 'Comma-separated MCP service profiles to verify', + 'mcp-filesystem,mcp-playwright,mcp-desktop-commander' + ) + .action(handleCommand('doctor', async (options) => { + const profileNames = String(options.mcpProfiles) + .split(',') + .map((item) => item.trim()) + .filter(Boolean); + + const checks: HealthCheck[] = []; + + // Check CLI build artifact + const buildCheck = checkCliBuildArtifact(); + checks.push(buildCheck); + + // Check CLI execution if build exists + if (buildCheck.ok) { + const distCliPath = join(process.cwd(), 'dist', 'cli', 'index.js'); + const execCheck = checkCliExecution(distCliPath); + if (execCheck) { + checks.push(execCheck); + } + } + + // Check Codex authentication + if (!options.skipCodexAuth) { + checks.push(checkCodexAuth()); + } + + // Check Codex MCP list + let codexMcpNames = new Set(); + const codexMcpList = spawnSync('codex', ['mcp', 'list', '--json'], { + cwd: process.cwd(), + encoding: 'utf8' + }); + if (codexMcpList.status === 0) { + try { + const parsed = JSON.parse(codexMcpList.stdout || '[]') as Array<{ name?: string }>; + codexMcpNames = new Set(parsed.map((entry) => String(entry.name)).filter(Boolean)); + checks.push({ + id: 'codex.mcp_list', + ok: true, + details: `Loaded ${codexMcpNames.size} Codex MCP registration(s).` + }); + } catch (error) { + checks.push({ + id: 'codex.mcp_list', + ok: false, + details: `Failed to parse codex mcp list output: ${(error as Error).message}`, + remediation: 'Run `codex mcp list --json` and inspect output.' + }); + } + } else { + checks.push({ + id: 'codex.mcp_list', + ok: false, + details: codexMcpList.stderr?.trim() || 'codex mcp list failed', + remediation: 'Verify Codex CLI install and MCP support (`codex mcp --help`).' + }); + } + + // Check MCP profiles using service manager + for (const profileName of profileNames) { + const status = await serviceManager.status(profileName); + const registration = serviceManager.codexRegistration(profileName); + const registered = registration ? codexMcpNames.has(registration.codexName) : true; + const healthy = status.healthy !== false; + const ok = status.running && healthy && registered; + + let details = `running=${status.running} healthy=${status.healthy === null ? 'n/a' : status.healthy} registered=${registered}`; + if (status.diagnostics.length) { + details += ` diagnostics=${status.diagnostics.join(' | ')}`; + } + + const remediationParts: string[] = []; + if (!status.running || !healthy) { + remediationParts.push(`codex-synaptic env up ${profileName}`); + } + if (registration && !registered) { + remediationParts.push(`codex-synaptic env codex-register ${profileName}`); + } + + checks.push({ + id: `mcp.${profileName}`, + ok, + details, + remediation: remediationParts.length ? remediationParts.join(' && ') : undefined, + metadata: { + codexName: registration?.codexName, + url: registration?.url + } + }); + } + + renderHealthCheckResults(checks, { json: options.json, strict: options.strict }); + })); + const memoryCmd = decorateCommandHelp( program .command('memory') @@ -5162,6 +5575,130 @@ hiveMindCmd }); })); +// TUI mode +const tuiCmd = decorateCommandHelp( + program + .command('tui') + .description('Launch the live terminal dashboard (Ink-based TUI)'), + { + title: 'TUI Monitor Deck', + subtitle: 'Run a live terminal dashboard backed by local or daemon telemetry.', + context: [ + 'TUI mode gives you a persistent operational pane with low-latency status updates.', + 'If a detached daemon is running, attach mode avoids creating a second orchestrator instance.' + ], + skills: [ + 'Track agent/scheduler health in one view while you run swarm and bridge workflows.', + 'Use refresh/quit key bindings to keep diagnostics fast during incident response.' + ], + vibeTips: [ + 'Use daemon attach mode for long-lived monitoring while other shells run task commands.' + ], + actions: [ + { command: 'codex-synaptic tui --attach-daemon', description: 'Attach to background daemon telemetry.' }, + { command: 'codex-synaptic tui', description: 'Start a local runtime dashboard in this shell.' } + ], + docs: [ + { label: 'docs/guides/codex-macos-workflows.md', description: 'Operational workflow for Local/Worktree/Cloud and MCP setup.' } + ] + } +); + +tuiCmd + .option('--attach-daemon', 'Attach to detached daemon state instead of starting a local runtime') + .option('--local', 'Force local in-process runtime dashboard') + .option('-i, --interval ', 'Refresh interval in milliseconds', '1000') + .option('--tier ', 'UI tier hint (beginner|intermediate|advanced)', 'intermediate') + .action(handleCommand('tui', async (options) => { + const intervalMs = parseInteger(options.interval, 'interval'); + const tier = String(options.tier ?? 'intermediate') as InterfaceTier; + if (!['beginner', 'intermediate', 'advanced'].includes(tier)) { + throw new Error('tier must be one of beginner|intermediate|advanced'); + } + + const background = getBackgroundStatus(); + const attachDaemon = Boolean(options.attachDaemon) || (!options.local && background.running && !session.getSystemUnsafe()); + + if (attachDaemon) { + if (!background.running) { + throw new Error('Background daemon is not running. Start it with `codex-synaptic background start`.'); + } + + await startTui({ + initialTier: tier, + provider: { + sourceLabel: 'daemon', + refreshIntervalMs: intervalMs, + fetchSnapshot: async () => { + const snapshot = await queryBackgroundRuntimeSnapshot(); + if (!snapshot) { + throw new Error('Daemon snapshot unavailable.'); + } + return { + source: 'daemon', + ...snapshot + } as TuiRuntimeSnapshot; + } + } + }); + return; + } + + if (background.running && process.env.CODEX_ALLOW_LOCAL_WITH_DAEMON !== '1') { + throw new Error( + 'Background daemon is already running. Use `codex-synaptic tui --attach-daemon` ' + + 'or stop the daemon first to avoid split-brain orchestration.' + ); + } + + bootstrapEnvForCli(); + const hadSystem = Boolean(session.getSystemUnsafe()); + const system = hadSystem ? session.getSystemUnsafe()! : await session.ensureSystem(); + + await startTui({ + initialTier: tier, + provider: { + sourceLabel: 'local', + refreshIntervalMs: intervalMs, + fetchSnapshot: async () => { + const status = system.getStatus(); + const registryStatus = system.getAgentRegistry().getStatus(); + return { + source: 'local', + pid: process.pid, + startedAt: undefined, + updatedAt: new Date().toISOString(), + cwd: process.cwd(), + interfaceMode: 'tui', + tier, + status: { + initialized: Boolean(status?.initialized), + shuttingDown: Boolean(status?.shuttingDown), + daemon: false + }, + telemetry: { + agents: { + total: registryStatus.totalAgents, + available: registryStatus.availableAgents, + byType: { ...registryStatus.typeCounts }, + byStatus: { ...registryStatus.statusCounts } + }, + resources: system.getResourceManager().getCurrentUsage(), + mesh: system.getNeuralMesh().getStatus(), + swarm: system.getSwarmCoordinator().getStatus(), + consensus: system.getConsensusManager().getStatus(), + recentTasks: session.getTelemetry().recentTasks + } + } as TuiRuntimeSnapshot; + } + } + }); + + if (!hadSystem && cliAutoShutdown) { + await session.shutdown('tui-auto-shutdown'); + } + })); + // Interactive mode const interactiveCmd = decorateCommandHelp( program diff --git a/src/core/errors.ts b/src/core/errors.ts index 00700ad..2585f2e 100644 --- a/src/core/errors.ts +++ b/src/core/errors.ts @@ -35,7 +35,10 @@ export enum ErrorCode { // Bridge errors BRIDGE_ERROR = 'BRIDGE_ERROR', MCP_ERROR = 'MCP_ERROR', - A2A_ERROR = 'A2A_ERROR' + A2A_ERROR = 'A2A_ERROR', + + // CLI/Daemon errors + DAEMON_CONFLICT = 'DAEMON_CONFLICT' } export class CodexSynapticError extends Error { @@ -111,6 +114,16 @@ export class BridgeError extends CodexSynapticError { } } +/** + * Error thrown when a daemon conflict is detected (split-brain prevention) + */ +export class DaemonConflictError extends CodexSynapticError { + constructor(message: string, context?: Record) { + super(ErrorCode.DAEMON_CONFLICT, message, context, false); + this.name = 'DaemonConflictError'; + } +} + /** * Circuit breaker for handling failures gracefully */ diff --git a/src/env/service-manager.ts b/src/env/service-manager.ts index 886ab6c..fea107d 100644 --- a/src/env/service-manager.ts +++ b/src/env/service-manager.ts @@ -1,11 +1,27 @@ import { execSync } from 'child_process'; +import { createConnection } from 'net'; import { setTimeout as sleep } from 'timers/promises'; import { Logger } from '../core/logger.js'; +export class ServiceManagerError extends Error { + constructor(message: string, cause?: Error) { + super(message); + this.name = 'ServiceManagerError'; + if (cause) { + this.cause = cause; + } + } +} + +export type FilesystemAccessMode = 'read-only' | 'controlled-write'; + export interface ServiceProfile { description: string; composeFile: string; services?: string[]; + port?: number; + requiredEnv?: string[]; + codexName?: string; healthcheck?: { url: string; timeoutMs?: number; @@ -16,7 +32,16 @@ export interface ServiceProfile { export interface ServiceStatus { name: string; running: boolean; + healthy: boolean | null; raw: string; + diagnostics: string[]; + checkedAt: string; +} + +export interface EnsureServiceOptions { + waitForHealth?: boolean; + filesystemMode?: FilesystemAccessMode; + allowFilesystemWrite?: boolean; } const PROFILES: Record = { @@ -24,6 +49,7 @@ const PROFILES: Record = { description: 'Prometheus/Grafana stack with exporters', composeFile: 'docker/observability/docker-compose.observability.yml', services: ['prometheus', 'grafana', 'loki', 'promtail', 'node_exporter', 'cadvisor'], + port: 9090, healthcheck: { url: 'http://localhost:9090/-/ready', timeoutMs: 60_000, @@ -34,6 +60,7 @@ const PROFILES: Record = { description: 'Qdrant vector database', composeFile: 'docker/vector/docker-compose.qdrant.yml', services: ['qdrant'], + port: 6333, healthcheck: { url: 'http://localhost:6333/healthz', timeoutMs: 30_000, @@ -44,6 +71,7 @@ const PROFILES: Record = { description: 'Redis (Redis Stack) instance', composeFile: 'docker/vector/docker-compose.redis.yml', services: ['redis'], + port: 6379, healthcheck: { url: 'http://localhost:8001', timeoutMs: 20_000, @@ -53,32 +81,55 @@ const PROFILES: Record = { 'mcp-github': { description: 'GitHub MCP server', composeFile: 'docker/mcp/docker-compose.github.yml', - services: ['mcp-github'] + services: ['mcp-github'], + port: 7010, + requiredEnv: ['GITHUB_TOKEN'], + codexName: 'github' }, 'mcp-context7': { description: 'Context7 browser MCP server', composeFile: 'docker/mcp/docker-compose.context7.yml', - services: ['mcp-context7'] + services: ['mcp-context7'], + port: 7020, + requiredEnv: ['CONTEXT7_API_KEY'], + codexName: 'context7' }, 'mcp-playwright': { description: 'Playwright automation MCP server', composeFile: 'docker/mcp/docker-compose.playwright.yml', - services: ['mcp-playwright'] + services: ['mcp-playwright'], + port: 7030, + codexName: 'playwright-local' }, 'mcp-filesystem': { - description: 'Local filesystem MCP server', + description: 'Local filesystem MCP server (read-only by default)', composeFile: 'docker/mcp/docker-compose.filesystem.yml', - services: ['mcp-filesystem'] + services: ['mcp-filesystem'], + port: 7040, + codexName: 'filesystem-local' + }, + 'mcp-desktop-commander': { + description: 'Desktop Commander MCP server for desktop/tooling automation', + composeFile: 'docker/mcp/docker-compose.desktop-commander.yml', + services: ['mcp-desktop-commander'], + port: 7070, + codexName: 'desktop-commander' }, 'mcp-tavily': { description: 'Tavily search MCP server', composeFile: 'docker/mcp/docker-compose.tavily.yml', - services: ['mcp-tavily'] + services: ['mcp-tavily'], + port: 7050, + requiredEnv: ['TAVILY_API_KEY'], + codexName: 'tavily' }, 'mcp-firecrawl': { description: 'Firecrawl MCP server', composeFile: 'docker/mcp/docker-compose.firecrawl.yml', - services: ['mcp-firecrawl'] + services: ['mcp-firecrawl'], + port: 7060, + requiredEnv: ['FIRECRAWL_API_KEY'], + codexName: 'firecrawl' } }; @@ -110,14 +161,43 @@ class ServiceManager { return profile; } - async ensureService(name: string, options?: { waitForHealth?: boolean }): Promise { + private resolveFilesystemMode(options?: EnsureServiceOptions): FilesystemAccessMode { + const envMode = process.env.CODEX_MCP_FILESYSTEM_MODE; + const requested = options?.filesystemMode || (envMode as FilesystemAccessMode | undefined) || 'read-only'; + if (requested !== 'read-only' && requested !== 'controlled-write') { + throw new ServiceManagerError('Filesystem mode must be read-only or controlled-write.'); + } + return requested; + } + + private resolveExecEnv(name: string, options?: EnsureServiceOptions): NodeJS.ProcessEnv { + const env: NodeJS.ProcessEnv = { ...process.env }; + + if (name === 'mcp-filesystem') { + const mode = this.resolveFilesystemMode(options); + const allowWrite = options?.allowFilesystemWrite === true || process.env.CODEX_MCP_FILESYSTEM_ALLOW_WRITE === '1'; + if (mode === 'controlled-write' && !allowWrite) { + throw new ServiceManagerError( + 'controlled-write filesystem mode requires explicit approval. ' + + 'Pass --allow-filesystem-write or set CODEX_MCP_FILESYSTEM_ALLOW_WRITE=1.' + ); + } + env.MCP_FILESYSTEM_MOUNT_MODE = mode === 'controlled-write' ? 'rw' : 'ro'; + } + + return env; + } + + async ensureService(name: string, options?: EnsureServiceOptions): Promise { const profile = this.getProfile(name); const cmd = composeCommand(profile, 'up -d', profile.services); + const env = this.resolveExecEnv(name, options); + this.logger.info('env', `Starting service ${name}`, { command: cmd }); - execSync(cmd, { stdio: 'inherit' }); + execSync(cmd, { stdio: 'inherit', env }); - if (options?.waitForHealth !== false && profile.healthcheck) { - await this.waitForHealth(profile.healthcheck); + if (options?.waitForHealth !== false) { + await this.waitForServiceHealth(name, profile); } } @@ -128,15 +208,55 @@ class ServiceManager { execSync(cmd, { stdio: 'inherit' }); } - status(name: string): ServiceStatus { + async status(name: string): Promise { const profile = this.getProfile(name); const cmd = composeCommand(profile, 'ps'); + const diagnostics: string[] = []; + + for (const required of profile.requiredEnv ?? []) { + if (!process.env[required]) { + diagnostics.push(`Missing required env var: ${required}`); + } + } + try { const output = execSync(cmd, { stdio: 'pipe' }).toString(); - const running = /Up/.test(output); - return { name, running, raw: output }; + const running = /\bUp\b/.test(output); + + if (!running) { + return { + name, + running, + healthy: false, + raw: output, + diagnostics, + checkedAt: new Date().toISOString() + }; + } + + const healthy = await this.probeService(profile); + if (healthy === false) { + diagnostics.push('Service process is running but health probe failed.'); + } + + return { + name, + running, + healthy, + raw: output, + diagnostics, + checkedAt: new Date().toISOString() + }; } catch (error) { - return { name, running: false, raw: (error as Error).message }; + diagnostics.push(`docker compose status failed: ${(error as Error).message}`); + return { + name, + running: false, + healthy: false, + raw: (error as Error).message, + diagnostics, + checkedAt: new Date().toISOString() + }; } } @@ -147,23 +267,97 @@ class ServiceManager { return names.map((name) => ({ name, profile: this.getProfile(name) })); } - private async waitForHealth(healthcheck: Required['healthcheck']): Promise { - const timeout = healthcheck.timeoutMs ?? 60_000; - const interval = healthcheck.intervalMs ?? 2_000; + codexRegistration(name: string): { codexName: string; url: string } | null { + const profile = this.getProfile(name); + if (!profile.codexName || !profile.port) { + return null; + } + + return { + codexName: profile.codexName, + url: `http://localhost:${profile.port}` + }; + } + + private async probeService(profile: ServiceProfile): Promise { + if (profile.healthcheck?.url) { + return this.probeHttp(profile.healthcheck.url, 2000); + } + + if (profile.port) { + return this.probeTcp('127.0.0.1', profile.port, 1500); + } + + return null; + } + + private async waitForServiceHealth(name: string, profile: ServiceProfile): Promise { + const timeoutMs = profile.healthcheck?.timeoutMs ?? 30_000; + const intervalMs = profile.healthcheck?.intervalMs ?? 2000; const start = Date.now(); - while (Date.now() - start < timeout) { - try { - const response = await fetch(healthcheck.url, { method: 'GET' }); - if (response.ok) { + while (Date.now() - start < timeoutMs) { + const healthy = await this.probeService(profile); + if (healthy === null || healthy === true) { + return; + } + + this.logger.debug('env', 'Health probe pending', { + profile: name, + elapsedMs: Date.now() - start + }); + await sleep(intervalMs); + } + + throw new Error(`Service healthcheck timed out for ${name}`); + } + + private async probeHttp(url: string, timeoutMs: number): Promise { + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), timeoutMs); + if (typeof timer.unref === 'function') { + timer.unref(); + } + + try { + const response = await fetch(url, { method: 'GET', signal: controller.signal }); + return response.ok; + } catch { + return false; + } finally { + clearTimeout(timer); + } + } + + private async probeTcp(host: string, port: number, timeoutMs: number): Promise { + return new Promise((resolve) => { + const socket = createConnection({ host, port }); + let settled = false; + + const finish = (result: boolean) => { + if (settled) { return; } - } catch (error) { - this.logger.debug('env', 'Healthcheck probe failed', { url: healthcheck.url, error: (error as Error).message }); + settled = true; + socket.destroy(); + resolve(result); + }; + + const timer = setTimeout(() => finish(false), timeoutMs); + if (typeof timer.unref === 'function') { + timer.unref(); } - await sleep(interval); - } - throw new Error(`Service healthcheck timed out (${healthcheck.url})`); + + socket.once('connect', () => { + clearTimeout(timer); + finish(true); + }); + + socket.once('error', () => { + clearTimeout(timer); + finish(false); + }); + }); } } diff --git a/src/tui/app.tsx b/src/tui/app.tsx index 3d44169..146b787 100644 --- a/src/tui/app.tsx +++ b/src/tui/app.tsx @@ -1,234 +1,113 @@ -/** - * TUI Application Entry Point - * - * Main Ink application component for the Terminal User Interface. - * This file provides the foundation for the React-based TUI. - * - * Note: Ink must be installed as a dependency to use this module: - * npm install ink ink-select-input ink-text-input ink-spinner - */ - -import React, { useReducer, useEffect, useCallback, useMemo } from 'react'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; import type { FC } from 'react'; import type { InterfaceTier } from '../core/config.js'; -import type { - TuiState, - TuiAction, - TuiViewType, - TuiPanel, -} from './types.js'; -import { getTheme } from './themes.js'; -import { getTuiAdapter } from './tui-adapter.js'; - -/** - * Default panels configuration - */ -const defaultPanels: TuiPanel[] = [ - { id: 'sidebar', title: 'Navigation', visible: true, position: 'left', width: 20 }, - { id: 'main', title: 'Main', visible: true, position: 'center' }, - { id: 'status', title: 'Status', visible: true, position: 'bottom', height: 3 }, - { id: 'details', title: 'Details', visible: false, position: 'right', width: 30, minTier: 'intermediate' }, -]; - -/** - * Initial TUI state - */ -function createInitialState(tier: InterfaceTier): TuiState { - return { - navigation: { - currentView: 'dashboard', - breadcrumbs: ['Dashboard'], - selectedIndex: 0, - scrollOffset: 0, - }, - theme: getTheme('dark'), - tier, - refreshInterval: 1000, - showShortcuts: true, - animations: true, - panels: defaultPanels, - pendingOutput: [], - activeProgress: new Map(), - connected: false, - lastUpdate: new Date(), +import { Logger } from '../core/logger.js'; + +export interface TuiRuntimeSnapshot { + source: 'local' | 'daemon'; + pid?: number; + startedAt?: string; + updatedAt?: string; + cwd?: string; + interfaceMode?: string; + tier?: InterfaceTier; + status: { + initialized: boolean; + shuttingDown: boolean; + daemon: boolean; + }; + telemetry: { + agents: { + total: number; + available: number; + byType: Record; + byStatus: Record; + }; + resources?: { + memoryMB?: number; + cpuPercent?: number; + activeAgents?: number; + concurrentTasks?: number; + requestsPerMinute?: number; + }; + mesh?: { + topology?: string; + nodeCount?: number; + connectionCount?: number; + }; + swarm?: { + isRunning?: boolean; + algorithm?: string; + particleCount?: number; + isOptimizing?: boolean; + }; + consensus?: { + isRunning?: boolean; + activeProposals?: number; + totalVotes?: number; + }; + recentTasks: Array<{ + id: string; + status: 'completed' | 'failed'; + summary?: string; + timestamp: string; + }>; }; } -/** - * TUI state reducer - */ -function tuiReducer(state: TuiState, action: TuiAction): TuiState { - switch (action.type) { - case 'NAVIGATE': { - const viewLabels: Record = { - dashboard: 'Dashboard', - agents: 'Agents', - tasks: 'Tasks', - mesh: 'Neural Mesh', - swarm: 'Swarm', - consensus: 'Consensus', - memory: 'Memory', - settings: 'Settings', - help: 'Help', - logs: 'Logs', - }; - - return { - ...state, - navigation: { - ...state.navigation, - previousView: state.navigation.currentView, - currentView: action.view, - breadcrumbs: [viewLabels[action.view]], - selectedIndex: 0, - scrollOffset: 0, - }, - }; - } - - case 'GO_BACK': - if (state.navigation.previousView) { - return tuiReducer(state, { type: 'NAVIGATE', view: state.navigation.previousView }); - } - return state; - - case 'SET_THEME': - return { - ...state, - theme: getTheme(action.theme), - }; - - case 'SET_TIER': - return { - ...state, - tier: action.tier, - panels: state.panels.map(panel => ({ - ...panel, - visible: panel.minTier ? shouldShowForTier(action.tier, panel.minTier) : panel.visible, - })), - }; - - case 'SET_REFRESH_INTERVAL': - return { - ...state, - refreshInterval: action.interval, - }; - - case 'TOGGLE_SHORTCUTS': - return { - ...state, - showShortcuts: !state.showShortcuts, - }; - - case 'TOGGLE_ANIMATIONS': - return { - ...state, - animations: !state.animations, - }; - - case 'TOGGLE_PANEL': { - return { - ...state, - panels: state.panels.map(panel => - panel.id === action.panelId - ? { ...panel, visible: !panel.visible } - : panel - ), - }; - } - - case 'ADD_OUTPUT': - return { - ...state, - pendingOutput: [...state.pendingOutput, action.payload].slice(-100), // Keep last 100 - lastUpdate: new Date(), - }; - - case 'CLEAR_OUTPUT': - return { - ...state, - pendingOutput: [], - }; - - case 'UPDATE_PROGRESS': { - const newProgress = new Map(state.activeProgress); - const existing = newProgress.get(action.id); - if (existing) { - newProgress.set(action.id, { ...existing, ...action.progress }); - } - return { - ...state, - activeProgress: newProgress, - }; - } - - case 'COMPLETE_PROGRESS': { - const newProgress = new Map(state.activeProgress); - newProgress.delete(action.id); - return { - ...state, - activeProgress: newProgress, - }; - } - - case 'SET_CONNECTED': - return { - ...state, - connected: action.connected, - }; - - case 'SET_SELECTION': - return { - ...state, - navigation: { - ...state.navigation, - selectedIndex: action.index, - }, - }; - - case 'SCROLL': - return { - ...state, - navigation: { - ...state.navigation, - scrollOffset: action.offset, - }, - }; - - default: - return state; - } +export interface TuiSnapshotProvider { + sourceLabel: string; + refreshIntervalMs?: number; + fetchSnapshot: () => Promise; } -/** - * Check if content should be shown for tier - */ -function shouldShowForTier(current: InterfaceTier, minimum: InterfaceTier): boolean { - const order: InterfaceTier[] = ['beginner', 'intermediate', 'advanced']; - return order.indexOf(current) >= order.indexOf(minimum); +interface InkBindings { + Box: React.ComponentType<{ + flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse'; + padding?: number; + marginTop?: number; + // Allow additional Ink Box props not explicitly typed here + [key: string]: any; + }>; + Text: React.ComponentType<{ + color?: string; + // Allow additional Ink Text props not explicitly typed here + [key: string]: any; + }>; + useInput: (handler: (input: string, key: { + upArrow: boolean; + downArrow: boolean; + leftArrow: boolean; + rightArrow: boolean; + return: boolean; + escape: boolean; + ctrl: boolean; + shift: boolean; + tab: boolean; + backspace: boolean; + delete: boolean; + // Allow additional key properties from Ink's Key type + [key: string]: boolean; + }) => void) => void; + useApp: () => { exit: () => void }; } -/** - * Props for the TUI App - */ export interface TuiAppProps { + provider: TuiSnapshotProvider; initialTier?: InterfaceTier; onExit?: () => void; + ink: InkBindings; } -/** - * TUI Context for sharing state with child components - */ export interface TuiContextValue { - state: TuiState; - dispatch: (action: TuiAction) => void; + snapshot?: TuiRuntimeSnapshot; + loading: boolean; + error?: string; + refreshedAt?: Date; } export const TuiContext = React.createContext(null); -/** - * Hook to use TUI context - */ export function useTui(): TuiContextValue { const context = React.useContext(TuiContext); if (!context) { @@ -237,134 +116,196 @@ export function useTui(): TuiContextValue { return context; } -/** - * Main TUI Application Component - * - * This is a placeholder implementation. The full implementation - * requires Ink to be installed and will include: - * - Navigation sidebar - * - Main content area with view routing - * - Status bar - * - Keyboard shortcuts - * - Theme support - */ -export const TuiApp: FC = ({ initialTier = 'intermediate', onExit }) => { - const [state, dispatch] = useReducer(tuiReducer, initialTier, createInitialState); - - // Connect to the TUI adapter +function truncate(input: string, max = 100): string { + if (input.length <= max) { + return input; + } + return `${input.slice(0, max - 1)}…`; +} + +function formatUpdatedLabel(snapshot?: TuiRuntimeSnapshot, refreshedAt?: Date): string { + const updatedAt = snapshot?.updatedAt ? new Date(snapshot.updatedAt) : refreshedAt; + if (!updatedAt) { + return 'unknown'; + } + return updatedAt.toLocaleTimeString(); +} + +export const TuiApp: FC = ({ provider, onExit, ink }) => { + const { Box, Text, useInput, useApp } = ink; + const { exit } = useApp(); + + const [snapshot, setSnapshot] = useState(undefined); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(undefined); + const [refreshedAt, setRefreshedAt] = useState(undefined); + + const refresh = useCallback(async () => { + try { + const next = await provider.fetchSnapshot(); + setSnapshot(next); + setError(undefined); + setRefreshedAt(new Date()); + } catch (refreshError) { + setError((refreshError as Error).message); + } finally { + setLoading(false); + } + }, [provider]); + useEffect(() => { - const adapter = getTuiAdapter(); - adapter.connectDispatcher(dispatch); - - // Set connected status - dispatch({ type: 'SET_CONNECTED', connected: true }); - - return () => { - dispatch({ type: 'SET_CONNECTED', connected: false }); - }; - }, []); - - // Handle keyboard shortcuts - const handleKeyPress = useCallback((key: string) => { - switch (key) { - case 'q': - onExit?.(); - break; - case 'd': - dispatch({ type: 'NAVIGATE', view: 'dashboard' }); - break; - case 'a': - dispatch({ type: 'NAVIGATE', view: 'agents' }); - break; - case 't': - dispatch({ type: 'NAVIGATE', view: 'tasks' }); - break; - case 'm': - dispatch({ type: 'NAVIGATE', view: 'mesh' }); - break; - case 's': - dispatch({ type: 'NAVIGATE', view: 'swarm' }); - break; - case 'c': - dispatch({ type: 'NAVIGATE', view: 'consensus' }); - break; - case '?': - dispatch({ type: 'NAVIGATE', view: 'help' }); - break; - case 'escape': - dispatch({ type: 'GO_BACK' }); - break; + void refresh(); + const interval = setInterval(() => { + void refresh(); + }, provider.refreshIntervalMs ?? 1000); + return () => clearInterval(interval); + }, [provider.refreshIntervalMs, refresh]); + + useInput((input, key) => { + if (key.ctrl && input === 'c') { + onExit?.(); + exit(); + return; + } + + if (input === 'q') { + onExit?.(); + exit(); + return; } - }, [onExit]); - - // Context value - const contextValue = useMemo(() => ({ state, dispatch }), [state]); - - // Note: This is a placeholder. The actual rendering would use Ink components: - // import { Box, Text, useInput } from 'ink'; - // - // return ( - // - // - //
- // - // - // - // {state.panels.find(p => p.id === 'details')?.visible && } - // - // - // - // - // ); - - return React.createElement( - TuiContext.Provider, - { value: contextValue }, - React.createElement('div', { - 'data-testid': 'tui-app', - 'data-view': state.navigation.currentView, - 'data-tier': state.tier, - 'data-connected': state.connected, - }, - `Codex-Synaptic TUI - ${state.navigation.currentView} (${state.tier} tier)` - ) + + if (input === 'r') { + void refresh(); + } + }); + + const contextValue = useMemo(() => ({ + snapshot, + loading, + error, + refreshedAt + }), [snapshot, loading, error, refreshedAt]); + + const recentTasks = snapshot?.telemetry.recentTasks ?? []; + + return ( + + + Codex-Synaptic TUI ({provider.sourceLabel}) + Shortcuts: q=quit, r=refresh + Last update: {formatUpdatedLabel(snapshot, refreshedAt)} + + {loading && Loading telemetry…} + {error && Error: {error}} + + {snapshot && ( + <> + + + Runtime: {snapshot.status.initialized ? 'ready' : 'not ready'} | source={snapshot.source} | daemon={snapshot.status.daemon ? 'yes' : 'no'} + + + Interface: {snapshot.interfaceMode ?? 'unknown'}/{snapshot.tier ?? 'unknown'} | shuttingDown={snapshot.status.shuttingDown ? 'yes' : 'no'} + + {snapshot.cwd && CWD: {truncate(snapshot.cwd, 120)}} + + + + Agents + + total={snapshot.telemetry.agents.total} available={snapshot.telemetry.agents.available} + + + + + Resources + + cpu={snapshot.telemetry.resources?.cpuPercent?.toFixed(2) ?? 'n/a'}% + {' | '} + memory={snapshot.telemetry.resources?.memoryMB?.toFixed(1) ?? 'n/a'}MB + {' | '} + tasks={snapshot.telemetry.resources?.concurrentTasks ?? 'n/a'} + + + + + Mesh / Swarm / Consensus + + mesh={snapshot.telemetry.mesh?.topology ?? 'n/a'} + {' | '} + swarm={snapshot.telemetry.swarm?.algorithm ?? 'n/a'} + {' | '} + consensusVotes={snapshot.telemetry.consensus?.totalVotes ?? 'n/a'} + + + + + Recent Tasks + {recentTasks.length === 0 && No recent tasks} + {recentTasks.slice(0, 6).map((task, index) => ( + + {index + 1}. {task.status.toUpperCase()} {task.id} {task.summary ? `- ${truncate(task.summary, 80)}` : ''} + + ))} + + + )} + + ); }; -/** - * Start the TUI application - * - * This function would normally use Ink's render function: - * import { render } from 'ink'; - * - * export async function startTui(options: TuiAppProps): Promise { - * const { waitUntilExit } = render(); - * await waitUntilExit(); - * } - */ -export async function startTui(options: TuiAppProps = {}): Promise { - // Placeholder implementation - console.log('TUI mode requires Ink to be installed.'); - console.log('Install with: npm install ink ink-select-input ink-text-input'); - console.log(''); - console.log('Starting with fallback CLI mode...'); - - // In a real implementation, this would render the Ink app - const { onExit } = options; - - // Simulate TUI running - return new Promise((resolve) => { - const cleanup = () => { +export interface StartTuiOptions { + provider: TuiSnapshotProvider; + onExit?: () => void; + initialTier?: InterfaceTier; +} + +function renderFallbackMessage(provider: TuiSnapshotProvider): void { + console.log('TUI dependencies are not installed.'); + console.log('Install with: npm install ink'); + console.log(`Falling back to snapshot mode (${provider.sourceLabel}).`); +} + +export async function startTui(options: StartTuiOptions): Promise { + const { provider, onExit, initialTier } = options; + const logger = Logger.getInstance(); + + let inkModule: any; + try { + inkModule = await import('ink'); + } catch { + logger.info('tui', 'TUI dependencies are not installed. Falling back to snapshot mode.', { + source: provider.sourceLabel + }); + logger.info('tui', 'Install with: npm install ink'); + + try { + const snapshot = await provider.fetchSnapshot(); + logger.info('tui', `Runtime ready: ${snapshot.status.initialized ? 'yes' : 'no'}`); + logger.info('tui', `Agents: ${snapshot.telemetry.agents.total}`); + } catch (error) { + logger.error('tui', 'Failed to fetch snapshot in fallback mode', error as Error); + } finally { onExit?.(); - resolve(); - }; - - process.on('SIGINT', cleanup); - process.on('SIGTERM', cleanup); - - // Keep running until signal received - console.log('Press Ctrl+C to exit.'); - }); + } + return; + } + + const { render, Box, Text, useInput, useApp } = inkModule; + const { waitUntilExit } = render( + , + { + exitOnCtrlC: true + } + ); + + await waitUntilExit(); } export default TuiApp; diff --git a/src/tui/index.ts b/src/tui/index.ts index 1546d5c..7d2dfe5 100644 --- a/src/tui/index.ts +++ b/src/tui/index.ts @@ -2,9 +2,6 @@ * TUI Module Entry Point * * Exports for the Ink-based Terminal User Interface. - * - * To use the TUI, install the required dependencies: - * npm install ink ink-select-input ink-text-input ink-spinner react */ // Types @@ -50,4 +47,10 @@ export { startTui, } from './app.js'; -export type { TuiAppProps, TuiContextValue } from './app.js'; +export type { + TuiAppProps, + TuiContextValue, + StartTuiOptions, + TuiSnapshotProvider, + TuiRuntimeSnapshot +} from './app.js'; diff --git a/tests/bridging/mcp-bridge.test.ts b/tests/bridging/mcp-bridge.test.ts new file mode 100644 index 0000000..b43cf7f --- /dev/null +++ b/tests/bridging/mcp-bridge.test.ts @@ -0,0 +1,77 @@ +import { afterEach, describe, expect, it, vi } from 'vitest'; +import { MCPBridge } from '../../src/bridging/mcp-bridge'; + +describe('MCPBridge', () => { + afterEach(() => { + vi.restoreAllMocks(); + delete process.env.CODEX_MCP_BRIDGE_RETRY_ATTEMPTS; + delete process.env.CODEX_MCP_BRIDGE_RETRY_DELAY_MS; + delete process.env.CODEX_MCP_BRIDGE_TIMEOUT_MS; + }); + + it('retries transient transport failures and succeeds', async () => { + process.env.CODEX_MCP_BRIDGE_RETRY_ATTEMPTS = '2'; + process.env.CODEX_MCP_BRIDGE_RETRY_DELAY_MS = '1'; + + const fetchMock = vi + .fn, ReturnType>() + .mockRejectedValueOnce(new Error('temporary network error')) + .mockRejectedValueOnce(new Error('temporary network error #2')) + .mockResolvedValueOnce(new Response(JSON.stringify({ ok: true }), { status: 200 })); + + vi.stubGlobal('fetch', fetchMock as any); + + const bridge = new MCPBridge(); + await bridge.initialize(); + await bridge.connectEndpoint('http://localhost:8081'); + + const result = await bridge.sendMessage('http://localhost:8081', { ping: true }); + + expect(result.ok).toBe(true); + expect(result.attempts).toBe(3); + expect(fetchMock).toHaveBeenCalledTimes(3); + }); + + it('returns structured timeout errors', async () => { + process.env.CODEX_MCP_BRIDGE_RETRY_ATTEMPTS = '0'; + process.env.CODEX_MCP_BRIDGE_TIMEOUT_MS = '25'; + + const abortError = new DOMException('The operation was aborted.', 'AbortError'); + const fetchMock = vi + .fn, ReturnType>() + .mockRejectedValue(abortError); + vi.stubGlobal('fetch', fetchMock as any); + + const bridge = new MCPBridge(); + await bridge.initialize(); + await bridge.connectEndpoint('http://localhost:8081'); + + const result = await bridge.sendMessage('http://localhost:8081', { ping: true }); + + expect(result.ok).toBe(false); + expect(result.error?.code).toBe('timeout'); + expect(result.error?.retryable).toBe(true); + expect(result.attempts).toBe(1); + }); + + it('does not retry non-retryable upstream 4xx errors', async () => { + process.env.CODEX_MCP_BRIDGE_RETRY_ATTEMPTS = '3'; + + const fetchMock = vi + .fn, ReturnType>() + .mockResolvedValue(new Response(JSON.stringify({ error: 'bad request' }), { status: 400 })); + vi.stubGlobal('fetch', fetchMock as any); + + const bridge = new MCPBridge(); + await bridge.initialize(); + await bridge.connectEndpoint('http://localhost:8081'); + + const result = await bridge.sendMessage('http://localhost:8081', { ping: true }); + + expect(result.ok).toBe(false); + expect(result.status).toBe(400); + expect(result.error?.code).toBe('upstream_error'); + expect(result.error?.retryable).toBe(false); + expect(fetchMock).toHaveBeenCalledTimes(1); + }); +}); diff --git a/tests/cli/commands.test.ts b/tests/cli/commands.test.ts index 4633e88..8dea6a4 100644 --- a/tests/cli/commands.test.ts +++ b/tests/cli/commands.test.ts @@ -1,4 +1,6 @@ import { execFileSync } from 'node:child_process'; +import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; import { join } from 'node:path'; import { beforeAll, describe, expect, it } from 'vitest'; @@ -67,4 +69,58 @@ describe('Codex-Synaptic CLI commands', () => { expect(stderr).toContain('--dry-run can only be used together with --codex'); } }); + + it('reads daemon-backed system status snapshots without starting a local runtime', () => { + const tempHome = mkdtempSync(join(tmpdir(), 'codex-daemon-status-')); + const daemonDir = join(tempHome, '.codex-synaptic'); + mkdirSync(daemonDir, { recursive: true }); + + const runtimePath = join(daemonDir, 'daemon-runtime.json'); + const statePath = join(daemonDir, 'daemon.json'); + const now = new Date().toISOString(); + + writeFileSync(statePath, JSON.stringify({ + pid: process.pid, + startedAt: now, + interfaceMode: 'cli', + tier: 'intermediate', + cwd: projectRoot, + socketPath: join(daemonDir, 'daemon.sock'), + runtimePath, + logFile: join(projectRoot, 'logs', 'daemon.log') + }, null, 2)); + + writeFileSync(runtimePath, JSON.stringify({ + pid: process.pid, + startedAt: now, + updatedAt: now, + cwd: projectRoot, + interfaceMode: 'cli', + tier: 'intermediate', + status: { + initialized: true, + shuttingDown: false, + daemon: true + }, + telemetry: { + agents: { + total: 4, + available: 3, + byType: { code_worker: 2, consensus_coordinator: 2 }, + byStatus: { idle: 3, busy: 1 } + }, + resources: { memoryMB: 80, cpuPercent: 4 }, + mesh: { topology: 'mesh' }, + swarm: { algorithm: 'pso' }, + consensus: { totalVotes: 2 }, + recentTasks: [] + } + }, null, 2)); + + const output = runCli(['system', 'status'], { HOME: tempHome }); + expect(output).toContain('Daemon Runtime Snapshot'); + expect(output).toContain('Interface: cli/intermediate'); + + rmSync(tempHome, { recursive: true, force: true }); + }); }); diff --git a/tests/e2e/cli-smoke.test.ts b/tests/e2e/cli-smoke.test.ts index 5986294..502c36e 100644 --- a/tests/e2e/cli-smoke.test.ts +++ b/tests/e2e/cli-smoke.test.ts @@ -114,6 +114,31 @@ describe('codex-synaptic CLI smoke suite', () => { expect(stdout).toContain('Mock Codex passthrough enabled (tests only)'); }); + it('documents expanded background daemon command surface', () => { + const { stdout } = runCli(['background', '--help']); + expect(stdout).toContain('attach'); + expect(stdout).toContain('logs'); + expect(stdout).toContain('restart'); + }); + + it('runs doctor command with actionable output', () => { + const { stdout } = runCli(['doctor']); + expect(stdout).toContain('Codex-Synaptic Doctor'); + expect(stdout).toContain('repo.cli_build_artifact'); + }); + + it('includes desktop commander profile in env planning', () => { + const { stdout } = runCli(['env', 'plan', 'mcp-desktop-commander']); + expect(stdout).toContain('mcp-desktop-commander'); + expect(stdout).toContain('codex mcp name'); + }); + + it('exposes the tui command surface', () => { + const { stdout } = runCli(['tui', '--help']); + expect(stdout).toContain('attach-daemon'); + expect(stdout).toContain('Launch the live terminal dashboard'); + }); + it('emits startup auth warnings for invalid OpenAI credentials without stack trace noise', () => { const { status, stderr } = runCli(['openai', 'usage', '--json'], { allowFailure: true, diff --git a/tests/env/service-manager.test.ts b/tests/env/service-manager.test.ts index fdc7b50..a0bd65d 100644 --- a/tests/env/service-manager.test.ts +++ b/tests/env/service-manager.test.ts @@ -17,4 +17,18 @@ describe('serviceManager profiles', () => { const plan = serviceManager.plan(['qdrant', 'redis']); expect(plan.map((item) => item.name)).toEqual(['qdrant', 'redis']); }); + + it('includes desktop commander MCP profile', () => { + const profile = serviceManager.getProfile('mcp-desktop-commander'); + expect(profile.composeFile).toContain('desktop-commander'); + expect(profile.port).toBe(7070); + }); + + it('exposes codex registration metadata for MCP profiles', () => { + const registration = serviceManager.codexRegistration('mcp-filesystem'); + expect(registration).toEqual({ + codexName: 'filesystem-local', + url: 'http://localhost:7040' + }); + }); });