Merge branch 'main' into fix315
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -28,11 +28,5 @@ If applicable, add screenshots to help explain your problem.
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/discussion-thread.md
vendored
@ -2,7 +2,7 @@
|
||||
name: Discussion thread
|
||||
about: Start an open ended discussion
|
||||
title: 'Discussion: [TOPIC HERE]'
|
||||
labels: ''
|
||||
labels: 'type: discussion'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
@ -11,4 +11,6 @@ assignees: ''
|
||||
|
||||
**Discussion**
|
||||
|
||||
**Alternatives**
|
||||
|
||||
**Resources**
|
||||
|
||||
26
.github/release-drafter.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
categories:
|
||||
- title: '🚀 Features'
|
||||
labels:
|
||||
- 'type: enhancement'
|
||||
- 'type: epic'
|
||||
- 'type: feature request'
|
||||
- title: '🐛 Bug Fixes'
|
||||
labels:
|
||||
- 'type: bug'
|
||||
- title: '🧰 Maintenance'
|
||||
labels:
|
||||
- 'type: chore'
|
||||
- 'type: ci'
|
||||
- title: '📖 Documentaion'
|
||||
labels:
|
||||
- 'type: documentation'
|
||||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
template: |
|
||||
## Changes
|
||||
|
||||
$CHANGES
|
||||
|
||||
## Contributor
|
||||
|
||||
$CONTRIBUTORS
|
||||
26
.github/workflows/build-app.yml
vendored
@ -155,4 +155,28 @@ jobs:
|
||||
run: |
|
||||
yarn build:publish-linux
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
update_release_draft:
|
||||
needs: [build-macos, build-windows-x64, build-linux-x64]
|
||||
permissions:
|
||||
# write permission is required to create a github release
|
||||
contents: write
|
||||
# write permission is required for autolabeler
|
||||
# otherwise, read permission is required at least
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# (Optional) GitHub Enterprise requires GHE_HOST variable set
|
||||
#- name: Set GHE_HOST
|
||||
# run: |
|
||||
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
|
||||
|
||||
# Drafts your next Release notes as Pull Requests are merged into "master"
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
|
||||
# with:
|
||||
# config-name: my-config.yml
|
||||
# disable-autolabeler: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
18
.github/workflows/linter-and-test.yml
vendored
@ -26,6 +26,12 @@ jobs:
|
||||
test-on-macos:
|
||||
runs-on: [self-hosted, macOS, macos-desktop]
|
||||
steps:
|
||||
- name: 'Cleanup build folder'
|
||||
run: |
|
||||
ls -la ./
|
||||
rm -rf ./* || true
|
||||
rm -rf ./.??* || true
|
||||
ls -la ./
|
||||
- name: Getting the repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
@ -37,6 +43,7 @@ jobs:
|
||||
- name: Linter and test
|
||||
run: |
|
||||
yarn config set network-timeout 300000
|
||||
yarn build:core
|
||||
yarn install
|
||||
yarn lint
|
||||
yarn build:plugins
|
||||
@ -48,6 +55,9 @@ jobs:
|
||||
test-on-windows:
|
||||
runs-on: [self-hosted, Windows, windows-desktop]
|
||||
steps:
|
||||
- name: Clean workspace
|
||||
run: |
|
||||
Remove-Item -Path .\* -Force -Recurse
|
||||
- name: Getting the repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
@ -59,6 +69,7 @@ jobs:
|
||||
- name: Linter and test
|
||||
run: |
|
||||
yarn config set network-timeout 300000
|
||||
yarn build:core
|
||||
yarn install
|
||||
yarn lint
|
||||
yarn build:plugins
|
||||
@ -68,6 +79,12 @@ jobs:
|
||||
test-on-ubuntu:
|
||||
runs-on: [self-hosted, Linux, ubuntu-desktop]
|
||||
steps:
|
||||
- name: 'Cleanup build folder'
|
||||
run: |
|
||||
ls -la ./
|
||||
rm -rf ./* || true
|
||||
rm -rf ./.??* || true
|
||||
ls -la ./
|
||||
- name: Getting the repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
@ -81,6 +98,7 @@ jobs:
|
||||
export DISPLAY=$(w -h | awk 'NR==1 {print $2}')
|
||||
echo -e "Display ID: $DISPLAY"
|
||||
yarn config set network-timeout 300000
|
||||
yarn build:core
|
||||
yarn install
|
||||
yarn lint
|
||||
yarn build:plugins
|
||||
|
||||
66
.github/workflows/publish-plugin-core.yml
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
name: Publish Plugin-core Package to npmjs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "plugin-core/**"
|
||||
- ".github/workflows/publish-plugin-core.yml"
|
||||
- "!plugin-core/package.json"
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
environment: production
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: "0"
|
||||
token: ${{ secrets.PAT_SERVICE_ACCOUNT }}
|
||||
|
||||
- name: Install jq
|
||||
uses: dcarbone/install-jq-action@v2.0.1
|
||||
|
||||
- name: "Auto Increase package Version"
|
||||
run: |
|
||||
# Extract current version
|
||||
current_version=$(jq -r '.version' plugin-core/package.json)
|
||||
|
||||
# Break the version into its components
|
||||
major_version=$(echo $current_version | cut -d "." -f 1)
|
||||
minor_version=$(echo $current_version | cut -d "." -f 2)
|
||||
patch_version=$(echo $current_version | cut -d "." -f 3)
|
||||
|
||||
# Increment the patch version by one
|
||||
new_patch_version=$((patch_version+1))
|
||||
|
||||
# Construct the new version
|
||||
new_version="$major_version.$minor_version.$new_patch_version"
|
||||
|
||||
# Replace the old version with the new version in package.json
|
||||
jq --arg version "$new_version" '.version = $version' plugin-core/package.json > /tmp/package.json && mv /tmp/package.json plugin-core/package.json
|
||||
|
||||
# Print the new version
|
||||
echo "Updated package.json version to: $new_version"
|
||||
|
||||
# Setup .npmrc file to publish to npm
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "20.x"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
- run: npm install && npm run build
|
||||
working-directory: ./plugin-core
|
||||
- run: npm publish --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
working-directory: ./plugin-core
|
||||
|
||||
- name: "Commit new version to main and create tag"
|
||||
run: |
|
||||
version=$(jq -r '.version' plugin-core/package.json)
|
||||
git config --global user.email "service@jan.ai"
|
||||
git config --global user.name "Service Account"
|
||||
git add plugin-core/package.json
|
||||
git commit -m "${GITHUB_REPOSITORY}: Update tag build $version"
|
||||
git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main
|
||||
git tag -a plugin-core-$version -m "${GITHUB_REPOSITORY}: Update tag build $version for plugin-core"
|
||||
git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin plugin-core-$version
|
||||
1
.gitignore
vendored
@ -13,3 +13,4 @@ build
|
||||
electron/renderer
|
||||
|
||||
*.log
|
||||
plugin-core/lib
|
||||
|
||||
699
LICENSE
@ -1,79 +1,674 @@
|
||||
# License
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
This software is licensed under the following conditions:
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
- All third party components incorporated into the software are licensed under the original license
|
||||
provided by the owner of the applicable component.
|
||||
- Content outside of the above mentioned files or restrictions is available under the "Sustainable Use
|
||||
License" as defined below.
|
||||
Preamble
|
||||
|
||||
# Sustainable Use License
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
## Acceptance
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
By utilizing the software, you consent to all of the terms and conditions outlined below.
|
||||
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.
|
||||
|
||||
## Copyright License
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
The licensor provides you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license
|
||||
to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject
|
||||
to the restrictions below.
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
## Restrictions
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
The software may be used or modified only for your own internal business purposes or for non-commercial or
|
||||
personal use. Distribution of the software or provision to others is only permitted if done free of charge for
|
||||
non-commercial purposes. You are prohibited from altering, removing, or obscuring any licensing, copyright, or other notices of
|
||||
the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
## Patents
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to
|
||||
license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case
|
||||
subject to the restrictions and conditions in this license. This license does not cover any patent claims that
|
||||
you cause to be infringed by modifications or additions to the software. If you or your company make any
|
||||
written claim that the software infringes or contributes to infringement of any patent, your patent license
|
||||
for the software granted under these terms ends immediately. If your company makes such a claim, your patent
|
||||
license ends immediately for work on behalf of your company.
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
## Notices
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
You must ensure that anyone who receives a copy of any part of the software from you also receives a copy of these
|
||||
terms. If you modify the software, you must include in any modified copies of the software a prominent notice
|
||||
stating that you have modified the software.
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
## No Other Rights
|
||||
1. Definitions.
|
||||
|
||||
These terms do not imply any licenses other than those expressly granted in these terms.
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
## Termination
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
If you use the software in violation of these terms, such use is not licensed, and your license will
|
||||
automatically terminate. If the licensor provides you with a notice of your violation, and you cease all
|
||||
violation of this license no later than 30 days after you receive that notice, your license will be reinstated
|
||||
retroactively. However, if you violate these terms after such reinstatement, any additional violation of these
|
||||
terms will cause your license to terminate automatically and permanently.
|
||||
"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.
|
||||
|
||||
## No Liability
|
||||
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.
|
||||
|
||||
To the extent permitted by law, the software is provided "as is", without any warranty or condition, expressed or implied. In no event shall the authors or licensor be liable to you for any damages arising out of these terms or the use or nature of the software, under
|
||||
any kind of legal claim.
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
## Definitions
|
||||
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.
|
||||
|
||||
The “licensor” is the entity offering these terms.
|
||||
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.
|
||||
|
||||
The “software” is the software the licensor makes available under these terms, including any portion of it.
|
||||
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.
|
||||
|
||||
“You” refers to the individual or entity agreeing to these terms.
|
||||
1. Source Code.
|
||||
|
||||
“Your company” is any legal entity, sole proprietorship, or other kind of organization that you work for, plus
|
||||
all organizations that have control over, are under the control of, or are under common control with that
|
||||
organization. Control means ownership of substantially all the assets of an entity, or the power to direct its
|
||||
management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
||||
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.
|
||||
|
||||
“Your license” is the license granted to you for the software under these terms.
|
||||
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.
|
||||
|
||||
“Use” means anything you do with the software requiring your license.
|
||||
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.
|
||||
|
||||
“Trademark” means trademarks, service marks, and similar rights.
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
10
README.md
@ -1,8 +1,6 @@
|
||||
# Jan - Run your own AI
|
||||
|
||||
<p align="center">
|
||||
<img alt="janlogo" src="https://user-images.githubusercontent.com/69952136/266827788-b37d6f41-fc34-4677-aa1f-3e2ca6d3c91a.png">
|
||||
</p>
|
||||

|
||||
|
||||
<p align="center">
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||
@ -20,7 +18,9 @@
|
||||
|
||||
> ⚠️ **Jan is currently in Development**: Expect breaking changes and bugs!
|
||||
|
||||
**Use offline LLMs with your own data.** Run open source models like Llama2 or Falcon on your internal computers/servers.
|
||||
Jan runs Large Language Models and AIs on your own Windows, Mac or Linux computer. Jan can be run as a desktop app, or as a cloud-native deployment.
|
||||
|
||||
Jan is free and open source, under the GPLv3 license.
|
||||
|
||||
**Jan runs on any hardware.** From PCs to multi-GPU clusters, Jan supports universal architectures:
|
||||
|
||||
@ -73,7 +73,7 @@ To reset your installation:
|
||||
1. Delete Jan Application from /Applications
|
||||
|
||||
1. Clear cache:
|
||||
`rm -rf /Users/$(whoami)/Library/Application\ Support/jan-electron`
|
||||
`rm -rf /Users/$(whoami)/Library/Application\ Support/jan`
|
||||
OR
|
||||
`rm -rf /Users/$(whoami)/Library/Application\ Support/jan`
|
||||
|
||||
|
||||
55
adr/adr-002-jan-ai-apps.md
Normal file
@ -0,0 +1,55 @@
|
||||
# ADR #002: Jan AI apps
|
||||
|
||||
## Changelog
|
||||
- Oct 4th 2023: Initial draft
|
||||
- Oct 6th 2023: Update sample API
|
||||
|
||||
## Authors
|
||||
- @vuonghoainam - Hiro
|
||||
- @louis-jan
|
||||
|
||||
## Status
|
||||
Proposed
|
||||
|
||||
## Context
|
||||
|
||||
### Business context
|
||||
Jan can be a platform and let builders build their own `AI app` using existing tools
|
||||
- Use-case 1: Medical AI startup uploads "case notes" to Jan, wants to ask it questions (i.e. medical audit)
|
||||
- Use-case 2: Legal e-discovery: very large amount of documents (~10-15k pages) are uploaded, data is very private and cannot be leaked
|
||||
- Use-case 3: Jan wants to use Jan to have a QnA chatbot to answer questions on docs
|
||||
- Use-case 4: Jan wants to use Jan to have a codellama RAG on its own codebase, to generate new PRs
|
||||
|
||||
### Extra context
|
||||
- There are many use cases that the community can develop and sell to the users through Jan as plugin. Jan needs to streamline higher value chain.
|
||||
- This brings more value and more option to all kind of user
|
||||
- This can help building ecosystem and streamline value end to end (Jan, plugins/ model creators, Jan users - enterprise/ individual)
|
||||
- We at Jan cannot build plugins more on our own, but this one should serve as featured example like [OpenAI Retrieval plugin](https://github.com/openai/chatgpt-retrieval-plugin) does.
|
||||
- [#232](https://github.com/janhq/jan/issues/232)
|
||||
|
||||
## Decision
|
||||
|
||||
- User can browse and install plugins (with recommended model - llama2, claude, openai …) - This requires plugin dependencies.
|
||||
- Jan provide consistent interface for plugin developer to use:
|
||||
- Use LLM (this can be switched in runtime) - i.e Dev in llama2-7b but user can use with llama2-70b. Can choose another model as well
|
||||
- Plugin can have API for CRUD indices in vectorDB/ DB, and Jan only exposes corresponding data to the app
|
||||
- A place for a plugin to store the files for persistence
|
||||
- This works seamlessly on desktop/ Jan hosted version with Jan API abstraction.
|
||||
|
||||
### Simple UX
|
||||

|
||||
|
||||
### Component design
|
||||

|
||||
|
||||
## API
|
||||
- `jan.plugin.<plugin_name>.<function_name>(**args)`
|
||||
|
||||
- `jan.core.db.sql.command()` -> CRUD/ query
|
||||
- `jan.plugin.vectra.<function_name>(**args)` -> CRUD/ query for
|
||||
## Consequences
|
||||
- Jan user can build their own AI apps (and buy from others too) in an easy way
|
||||
- Clear design for plugin and Jan platform development
|
||||
|
||||
## Reference
|
||||
- [ADR-003](adr-003-jan-plugins.md)
|
||||
BIN
adr/images/adr-002-01.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
adr/images/adr-002-02.png
Normal file
|
After Width: | Height: | Size: 179 KiB |
@ -3,6 +3,8 @@ title: About Jan
|
||||
slug: /about
|
||||
---
|
||||
|
||||
## Team
|
||||
## Problem
|
||||
|
||||
## History
|
||||
## Ideal Customer Persona
|
||||
|
||||
## Business Model
|
||||
@ -1,10 +0,0 @@
|
||||
---
|
||||
title: Roadmap
|
||||
---
|
||||
|
||||
|
||||
## Problem
|
||||
|
||||
## Ideal Customer Persona
|
||||
|
||||
## Business Model
|
||||
4
docs/docs/about/team.md
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
title: Team
|
||||
---
|
||||
|
||||
51
docs/docs/events/hcmc-oct23.md
Normal file
@ -0,0 +1,51 @@
|
||||
---
|
||||
title: "Jan's AI Hacker House (Ho Chi Minh City)"
|
||||
description: "24-27 Oct 2023, Thao Dien, HCMC. AI-focused talks, workshops and social events. Hosted by Jan.ai"
|
||||
slug: /events/hcmc-oct23
|
||||
image: /img/hcmc-villa-1.jpeg
|
||||
---
|
||||
|
||||

|
||||
|
||||
## Ho Chi Minh City
|
||||
|
||||
[Jan's Hacker House](https://jan.ai) is a 4-day event where we host an open AI Hacker House and invite the local AI community to join us. There is fast wifi, free snacks, drinks and pizza.
|
||||
|
||||
We also host a series of talks, workshops and social events at night. We usually start off the week with a "Intro to LLMs" that targets local university students, and then progress to more in-depth technical and research areas.
|
||||
|
||||
Jan is a fully remote team. We use the money we save from not having an office, to hold Hack Weeks where we meet in a city, eat pizza and work to ship major releases.
|
||||
|
||||
### Date & Time
|
||||
|
||||
- 24-27 October 2023
|
||||
|
||||
### Location
|
||||
|
||||
- Thao Dien, District 2, Ho Chi Minh City
|
||||
- Exact location to be shared later
|
||||
|
||||
## Agenda
|
||||
|
||||
To help us manage RSVPs, please use the Eventbrite links below to RSVP for each event.
|
||||
|
||||
### Schedule
|
||||
|
||||
| Day | Eventbrite Link | Signups |
|
||||
| -------------- | -------------------------- | ------------------------------------------------------ |
|
||||
| Mon (23 Oct) | Jan Team & Partners Dinner | Invite-only |
|
||||
| Tues (24 Oct) | AI Talks Day 1 | [Eventbrite](https://jan-tech-talks-1.eventbrite.com) |
|
||||
| Wed (25 Oct) | AI Talks Day 2 | [Eventbrite](https://jan-tech-talks-2.eventbrite.com) |
|
||||
| Thurs (26 Oct) | VC Night | [Eventbrite](https://jan-hcmc-vc-night.eventbrite.com) |
|
||||
| Fri (27 Oct) | Jan Launch Party | [Eventbrite](https://jan-launch-party.eventbrite.com) |
|
||||
|
||||
### OKRs
|
||||
|
||||
| **Objective** | Jan v1.0 should be bug-free and run on Windows, Max, Linux |
|
||||
| ------------- | ---------------------------------------------------------- |
|
||||
| Key Result | "Create Bot" feature w/ Saved Prompts |
|
||||
| Key Result | *Stretch Goal:* Core Process API for Plugins |
|
||||
| Key Result | *Stretch Goal:* UI API for Plugins |
|
||||
|
||||
## Photos
|
||||
|
||||

|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Community Examples
|
||||
title: Hardware Examples
|
||||
---
|
||||
|
||||
## Add your own example
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
---
|
||||
title: "@dan-jan: 3090 Desktop"
|
||||
---
|
||||
@ -1,19 +1,24 @@
|
||||
---
|
||||
title: "@janhq: 2x4090 Workstation"
|
||||
title: "2 x 4090 Workstation"
|
||||
---
|
||||
|
||||

|
||||

|
||||
|
||||
## This is Jan 2x4090 Workstation setup components list:
|
||||
Jan uses a 2 x 4090 Workstation to run Codellama for internal use.[^1]
|
||||
|
||||
| Type | Item | Price |
|
||||
| :------------------- | :----------------------------------------------- | :------ |
|
||||
| **CPU** | [RYZEN THREADDRIPPER PRO 5965WX 280W SP3 WOF](#) | $2,229 |
|
||||
| **Motherboard** | [ASUS PRO WS WRX80E SAGE SE WIFI](#) | $933 |
|
||||
| **GPU** | [ASUS STRIX RTX 4090 24GB OC](#) | $4,345 |
|
||||
| **RAM** | [G.SKILL RIPJAW S5 2x32 6000C32](#) | $92.99 |
|
||||
| **Storage PCIe-SSD** | [SAMSUNG 990 PRO 2TB NVME 2.0](#) | $134.99 |
|
||||
| **Cooler** | [BEQUIET DARK ROCK 4 PRO TR4](#) | $89.90 |
|
||||
| **Power Supply** | [FSP CANNON 2000W PRO 92+ FULL MODULAR PSU](#) | $449.99 |
|
||||
| **Case** | [VEDDHA 6GPUS FRAME BLACK](#) | $59.99 |
|
||||
| **Total cost** | | $8334 |
|
||||
## Component List
|
||||
|
||||
| Type | Item | Unit Price | Total Price |
|
||||
| :------------------- | :------------------------------------------------------------- | :--------- | ----------- |
|
||||
| **CPU** | [Ryzen Threadripper Pro 5965WX 280W SP3 WOF](AMAZON-LINK-HERE) | $2,229 | |
|
||||
| **Motherboard** | [Asus Pro WS WRX80E Sage SE WiFi](AMAZON-LINK-HERE) | $933 | |
|
||||
| **RAM** | 4 x [G.Skill Ripjaw S5 2x32 6000C32](AMAZON-LINK-HERE) | $92.99 | |
|
||||
| **GPU** | 2 x [Asus Strix RTX 4090 24GB OC](AMAZON-LINK-HERE) | $4,345 | |
|
||||
| **Storage PCIe-SSD** | [Samsung 990 Pro 2TB NVME 2.0](AMAZON-LINK-HERE) | $134.99 | |
|
||||
| **Cooler** | [BeQuiet Dark Rock 4 Pro TR4](AMAZON-LINK-HERE) | $89.90 | |
|
||||
| **Power Supply** | [FSP Cannon 2000W Pro 92+ Full Modular PSU](AMAZON-LINK-HERE) | $449.99 | |
|
||||
| **Case** | [Veddha 6GPUs Frame Black](AMAZON-LINK-HERE) | $59.99 | |
|
||||
| **Total cost** | | $8,334 | |
|
||||
|
||||
|
||||
[^1]: https://www.reddit.com/r/LocalLLaMA/comments/16lxt6a/case_for_dual_4090s/. ideb
|
||||
@ -1,3 +1,3 @@
|
||||
---
|
||||
title: Self-hosted ChatGPT
|
||||
title: Self-Hosted ChatGPT
|
||||
---
|
||||
@ -127,7 +127,7 @@ const config = {
|
||||
type: "docSidebar",
|
||||
sidebarId: "solutionsSidebar",
|
||||
position: "left",
|
||||
label: "Use Cases",
|
||||
label: "Solutions",
|
||||
},
|
||||
{
|
||||
type: "docSidebar",
|
||||
@ -175,7 +175,7 @@ const config = {
|
||||
to: "/platform",
|
||||
},
|
||||
{
|
||||
label: "Use Cases",
|
||||
label: "Solutions",
|
||||
to: "/solutions",
|
||||
},
|
||||
],
|
||||
|
||||
983
docs/package-lock.json
generated
238
docs/sidebars.js
@ -43,28 +43,28 @@ const sidebars = {
|
||||
|
||||
// Note: Tab name is "Use Cases"
|
||||
solutionsSidebar: [
|
||||
"solutions/solutions",
|
||||
// "solutions/solutions",
|
||||
{
|
||||
type: "category",
|
||||
label: "Use cases",
|
||||
label: "Solutions",
|
||||
collapsible: true,
|
||||
collapsed: false,
|
||||
items: ["solutions/personal-ai", "solutions/self-hosted"],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Industries",
|
||||
collapsible: true,
|
||||
collapsed: false,
|
||||
items: [
|
||||
"solutions/industries/software",
|
||||
"solutions/industries/education",
|
||||
"solutions/industries/law",
|
||||
"solutions/industries/public-sector",
|
||||
"solutions/industries/finance",
|
||||
"solutions/industries/healthcare",
|
||||
],
|
||||
items: ["solutions/self-hosted", "solutions/personal-ai"],
|
||||
},
|
||||
// {
|
||||
// type: "category",
|
||||
// label: "Industries",
|
||||
// collapsible: true,
|
||||
// collapsed: false,
|
||||
// items: [
|
||||
// "solutions/industries/software",
|
||||
// "solutions/industries/education",
|
||||
// "solutions/industries/law",
|
||||
// "solutions/industries/public-sector",
|
||||
// "solutions/industries/finance",
|
||||
// "solutions/industries/healthcare",
|
||||
// ],
|
||||
// },
|
||||
],
|
||||
|
||||
docsSidebar: [
|
||||
@ -83,101 +83,101 @@ const sidebars = {
|
||||
],
|
||||
|
||||
hardwareSidebar: [
|
||||
{
|
||||
type: "category",
|
||||
label: "Overview",
|
||||
collapsible: true,
|
||||
collapsed: true,
|
||||
link: { type: "doc", id: "hardware/hardware" },
|
||||
items: [
|
||||
{
|
||||
type: "doc",
|
||||
label: "Cloud vs. Self-Hosting",
|
||||
id: "hardware/overview/cloud-vs-self-hosting",
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
label: "CPUs vs. GPUs",
|
||||
id: "hardware/overview/cpu-vs-gpu",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Recommendations",
|
||||
collapsible: true,
|
||||
collapsed: false,
|
||||
items: [
|
||||
{
|
||||
type: "doc",
|
||||
label: "By Hardware",
|
||||
id: "hardware/recommendations/by-hardware",
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
label: "By Budget",
|
||||
id: "hardware/recommendations/by-budget",
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
label: "By Model",
|
||||
id: "hardware/recommendations/by-model",
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
label: "By Use Case",
|
||||
id: "hardware/recommendations/by-usecase",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Anatomy of a Thinking Machine",
|
||||
collapsible: true,
|
||||
collapsed: true,
|
||||
link: { type: "doc", id: "hardware/concepts/concepts" },
|
||||
items: [
|
||||
{
|
||||
type: "doc",
|
||||
label: "Chassis",
|
||||
id: "hardware/concepts/chassis",
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
label: "Motherboard",
|
||||
id: "hardware/concepts/motherboard",
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
label: "CPU and RAM",
|
||||
id: "hardware/concepts/cpu-and-ram",
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
label: "GPU and VRAM",
|
||||
id: "hardware/concepts/gpu-and-vram",
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
label: "Storage",
|
||||
id: "hardware/concepts/storage",
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
label: "Network",
|
||||
id: "hardware/concepts/network",
|
||||
},
|
||||
// {
|
||||
// type: "category",
|
||||
// label: "Overview",
|
||||
// collapsible: true,
|
||||
// collapsed: true,
|
||||
// link: { type: "doc", id: "hardware/hardware" },
|
||||
// items: [
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "Cloud vs. Self-Hosting",
|
||||
// id: "hardware/overview/cloud-vs-self-hosting",
|
||||
// },
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "CPUs vs. GPUs",
|
||||
// id: "hardware/overview/cpu-vs-gpu",
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// type: "category",
|
||||
// label: "Recommendations",
|
||||
// collapsible: true,
|
||||
// collapsed: false,
|
||||
// items: [
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "By Hardware",
|
||||
// id: "hardware/recommendations/by-hardware",
|
||||
// },
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "By Budget",
|
||||
// id: "hardware/recommendations/by-budget",
|
||||
// },
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "By Model",
|
||||
// id: "hardware/recommendations/by-model",
|
||||
// },
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "By Use Case",
|
||||
// id: "hardware/recommendations/by-usecase",
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// type: "category",
|
||||
// label: "Anatomy of a Thinking Machine",
|
||||
// collapsible: true,
|
||||
// collapsed: true,
|
||||
// link: { type: "doc", id: "hardware/concepts/concepts" },
|
||||
// items: [
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "Chassis",
|
||||
// id: "hardware/concepts/chassis",
|
||||
// },
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "Motherboard",
|
||||
// id: "hardware/concepts/motherboard",
|
||||
// },
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "CPU and RAM",
|
||||
// id: "hardware/concepts/cpu-and-ram",
|
||||
// },
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "GPU and VRAM",
|
||||
// id: "hardware/concepts/gpu-and-vram",
|
||||
// },
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "Storage",
|
||||
// id: "hardware/concepts/storage",
|
||||
// },
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "Network",
|
||||
// id: "hardware/concepts/network",
|
||||
// },
|
||||
|
||||
{
|
||||
type: "doc",
|
||||
label: "Power Supply",
|
||||
id: "hardware/concepts/power",
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// type: "doc",
|
||||
// label: "Power Supply",
|
||||
// id: "hardware/concepts/power",
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
type: "category",
|
||||
label: "Community Examples",
|
||||
label: "Hardware Examples",
|
||||
collapsible: true,
|
||||
collapsed: true,
|
||||
link: { type: "doc", id: "hardware/community" },
|
||||
@ -194,23 +194,35 @@ const sidebars = {
|
||||
type: "category",
|
||||
label: "About Jan",
|
||||
collapsible: true,
|
||||
collapsed: false,
|
||||
collapsed: true,
|
||||
link: { type: "doc", id: "about/about" },
|
||||
items: [
|
||||
"about/roadmap",
|
||||
"about/team",
|
||||
{
|
||||
type: "link",
|
||||
label: "Careers",
|
||||
href: "https://janai.bamboohr.com/careers",
|
||||
},
|
||||
"about/brand-assets",
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Events",
|
||||
collapsible: true,
|
||||
collapsed: true,
|
||||
items: [
|
||||
{
|
||||
type: "doc",
|
||||
label: "Ho Chi Minh City (Oct 2023)",
|
||||
id: "events/hcmc-oct23",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Company Handbook",
|
||||
collapsible: true,
|
||||
collapsed: false,
|
||||
collapsed: true,
|
||||
link: { type: "doc", id: "handbook/handbook" },
|
||||
items: ["handbook/remote-work"],
|
||||
},
|
||||
|
||||
BIN
docs/static/img/2x4090-workstation.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
docs/static/img/github-readme-banner.png
vendored
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
docs/static/img/hcmc-villa-1.jpeg
vendored
Normal file
|
After Width: | Height: | Size: 228 KiB |
BIN
docs/static/img/hcmc-villa-2.jpeg
vendored
Normal file
|
After Width: | Height: | Size: 332 KiB |
833
docs/yarn.lock
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "./../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./../dist/cjs",
|
||||
"module": "commonjs"
|
||||
},
|
||||
"files": ["../module.ts"]
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "./../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./../dist/esm",
|
||||
"module": "esnext"
|
||||
},
|
||||
"files": ["../index.ts"]
|
||||
}
|
||||
@ -1,168 +1,187 @@
|
||||
import { core, store, RegisterExtensionPoint, StoreService, DataService } from "@janhq/plugin-core";
|
||||
|
||||
// Provide an async method to manipulate the price provided by the extension point
|
||||
const MODULE_PATH = "data-plugin/dist/module.js";
|
||||
const MODULE_PATH = "data-plugin/dist/cjs/module.js";
|
||||
|
||||
const storeModel = (model: any) =>
|
||||
new Promise((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "storeModel", model)
|
||||
.then((res: any) => resolve(res));
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Create a collection on data store
|
||||
*
|
||||
* @param name name of the collection to create
|
||||
* @param schema schema of the collection to create, include fields and their types
|
||||
* @returns Promise<void>
|
||||
*
|
||||
*/
|
||||
function createCollection({ name, schema }: { name: string; schema?: { [key: string]: any } }): Promise<void> {
|
||||
console.log("renderer: creating collection:", name, schema);
|
||||
return core.invokePluginFunc(MODULE_PATH, "createCollection", name, schema);
|
||||
}
|
||||
|
||||
const getFinishedDownloadModels = () =>
|
||||
new Promise((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "getFinishedDownloadModels")
|
||||
.then((res: any) => resolve(res));
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Delete a collection
|
||||
*
|
||||
* @param name name of the collection to delete
|
||||
* @returns Promise<void>
|
||||
*
|
||||
*/
|
||||
function deleteCollection(name: string): Promise<void> {
|
||||
return core.invokePluginFunc(MODULE_PATH, "deleteCollection", name);
|
||||
}
|
||||
|
||||
const getModelById = (modelId: string) =>
|
||||
new Promise((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "getModelById", modelId)
|
||||
.then((res: any) => resolve(res));
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Insert a value to a collection
|
||||
*
|
||||
* @param collectionName name of the collection
|
||||
* @param value value to insert
|
||||
* @returns Promise<any>
|
||||
*
|
||||
*/
|
||||
function insertOne({ collectionName, value }: { collectionName: string; value: any }): Promise<any> {
|
||||
return core.invokePluginFunc(MODULE_PATH, "insertOne", collectionName, value);
|
||||
}
|
||||
|
||||
const updateFinishedDownloadAt = (fileName: string) =>
|
||||
new Promise((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(
|
||||
MODULE_PATH,
|
||||
"updateFinishedDownloadAt",
|
||||
fileName,
|
||||
Date.now()
|
||||
)
|
||||
.then((res: any) => resolve(res));
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Update value of a collection's record
|
||||
*
|
||||
* @param collectionName name of the collection
|
||||
* @param key key of the record to update
|
||||
* @param value value to update
|
||||
* @returns Promise<void>
|
||||
*
|
||||
*/
|
||||
function updateOne({ collectionName, key, value }: { collectionName: string; key: string; value: any }): Promise<void> {
|
||||
return core.invokePluginFunc(MODULE_PATH, "updateOne", collectionName, key, value);
|
||||
}
|
||||
|
||||
const getUnfinishedDownloadModels = () =>
|
||||
new Promise<any>((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "getUnfinishedDownloadModels")
|
||||
.then((res: any[]) => resolve(res));
|
||||
} else {
|
||||
resolve([]);
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Updates all records that match a selector in a collection in the data store.
|
||||
* @param collectionName - The name of the collection containing the records to update.
|
||||
* @param selector - The selector to use to get the records to update.
|
||||
* @param value - The new value for the records.
|
||||
* @returns {Promise<void>} A promise that resolves when the records are updated.
|
||||
*/
|
||||
function updateMany({
|
||||
collectionName,
|
||||
value,
|
||||
selector,
|
||||
}: {
|
||||
collectionName: string;
|
||||
value: any;
|
||||
selector?: { [key: string]: any };
|
||||
}): Promise<void> {
|
||||
return core.invokePluginFunc(MODULE_PATH, "updateMany", collectionName, value, selector);
|
||||
}
|
||||
|
||||
const deleteDownloadModel = (modelId: string) =>
|
||||
new Promise((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "deleteDownloadModel", modelId)
|
||||
.then((res: any) => resolve(res));
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Delete a collection's record
|
||||
*
|
||||
* @param collectionName name of the collection
|
||||
* @param key key of the record to delete
|
||||
* @returns Promise<void>
|
||||
*
|
||||
*/
|
||||
function deleteOne({ collectionName, key }: { collectionName: string; key: string }): Promise<void> {
|
||||
return core.invokePluginFunc(MODULE_PATH, "deleteOne", collectionName, key);
|
||||
}
|
||||
|
||||
const getConversations = () =>
|
||||
new Promise<any>((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "getConversations")
|
||||
.then((res: any[]) => resolve(res));
|
||||
} else {
|
||||
resolve([]);
|
||||
}
|
||||
});
|
||||
const getConversationMessages = (id: any) =>
|
||||
new Promise((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "getConversationMessages", id)
|
||||
.then((res: any[]) => resolve(res));
|
||||
} else {
|
||||
resolve([]);
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Deletes all records with a matching key from a collection in the data store.
|
||||
*
|
||||
* @param collectionName name of the collection
|
||||
* @param selector selector to use to get the records to delete.
|
||||
* @returns {Promise<void>}
|
||||
*
|
||||
*/
|
||||
function deleteMany({
|
||||
collectionName,
|
||||
selector,
|
||||
}: {
|
||||
collectionName: string;
|
||||
selector?: { [key: string]: any };
|
||||
}): Promise<void> {
|
||||
return core.invokePluginFunc(MODULE_PATH, "deleteMany", collectionName, selector);
|
||||
}
|
||||
|
||||
const createConversation = (conversation: any) =>
|
||||
new Promise((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "storeConversation", conversation)
|
||||
.then((res: any) => {
|
||||
resolve(res);
|
||||
});
|
||||
} else {
|
||||
resolve(undefined);
|
||||
}
|
||||
});
|
||||
const createMessage = (message: any) =>
|
||||
new Promise((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "storeMessage", message)
|
||||
.then((res: any) => {
|
||||
resolve(res);
|
||||
});
|
||||
} else {
|
||||
resolve(undefined);
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Retrieve a record from a collection in the data store.
|
||||
* @param {string} collectionName - The name of the collection containing the record to retrieve.
|
||||
* @param {string} key - The key of the record to retrieve.
|
||||
* @returns {Promise<any>} A promise that resolves when the record is retrieved.
|
||||
*/
|
||||
function findOne({ collectionName, key }: { collectionName: string; key: string }): Promise<any> {
|
||||
return core.invokePluginFunc(MODULE_PATH, "findOne", collectionName, key);
|
||||
}
|
||||
|
||||
const updateMessage = (message: any) =>
|
||||
new Promise((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "updateMessage", message)
|
||||
.then((res: any) => {
|
||||
resolve(res);
|
||||
});
|
||||
} else {
|
||||
resolve(undefined);
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Gets records in a collection in the data store using a selector.
|
||||
* @param {string} collectionName - The name of the collection containing the record to get the value from.
|
||||
* @param {{ [key: string]: any }} selector - The selector to use to get the value from the record.
|
||||
* @param {[{ [key: string]: any }]} sort - The sort options to use to retrieve records.
|
||||
* @returns {Promise<any>} A promise that resolves with the selected value.
|
||||
*/
|
||||
function findMany({
|
||||
collectionName,
|
||||
selector,
|
||||
sort,
|
||||
}: {
|
||||
collectionName: string;
|
||||
selector: { [key: string]: any };
|
||||
sort?: [{ [key: string]: any }];
|
||||
}): Promise<any> {
|
||||
return core.invokePluginFunc(MODULE_PATH, "findMany", collectionName, selector, sort);
|
||||
}
|
||||
|
||||
const deleteConversation = (id: any) =>
|
||||
new Promise((resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "deleteConversation", id)
|
||||
.then((res: any) => {
|
||||
resolve(res);
|
||||
});
|
||||
} else {
|
||||
resolve("-");
|
||||
}
|
||||
});
|
||||
|
||||
const setupDb = () => {
|
||||
window.electronAPI.invokePluginFunc(MODULE_PATH, "init");
|
||||
};
|
||||
function onStart() {
|
||||
createCollection({ name: "conversations", schema: {} });
|
||||
createCollection({ name: "messages", schema: {} });
|
||||
}
|
||||
|
||||
// Register all the above functions and objects with the relevant extension points
|
||||
export function init({ register }: { register: any }) {
|
||||
setupDb();
|
||||
register("getConversations", "getConv", getConversations, 1);
|
||||
register("createConversation", "insertConv", createConversation);
|
||||
register("updateMessage", "updateMessage", updateMessage);
|
||||
register("deleteConversation", "deleteConv", deleteConversation);
|
||||
register("createMessage", "insertMessage", createMessage);
|
||||
register("getConversationMessages", "getMessages", getConversationMessages);
|
||||
register("storeModel", "storeModel", storeModel);
|
||||
register(
|
||||
"updateFinishedDownloadAt",
|
||||
"updateFinishedDownloadAt",
|
||||
updateFinishedDownloadAt
|
||||
);
|
||||
register(
|
||||
"getUnfinishedDownloadModels",
|
||||
"getUnfinishedDownloadModels",
|
||||
getUnfinishedDownloadModels
|
||||
);
|
||||
register("deleteDownloadModel", "deleteDownloadModel", deleteDownloadModel);
|
||||
register("getModelById", "getModelById", getModelById);
|
||||
register(
|
||||
"getFinishedDownloadModels",
|
||||
"getFinishedDownloadModels",
|
||||
getFinishedDownloadModels
|
||||
);
|
||||
export function init({ register }: { register: RegisterExtensionPoint }) {
|
||||
onStart();
|
||||
|
||||
register(StoreService.CreateCollection, createCollection.name, createCollection);
|
||||
register(StoreService.DeleteCollection, deleteCollection.name, deleteCollection);
|
||||
register(StoreService.InsertOne, insertOne.name, insertOne);
|
||||
register(StoreService.UpdateOne, updateOne.name, updateOne);
|
||||
register(StoreService.UpdateMany, updateMany.name, updateMany);
|
||||
register(StoreService.DeleteOne, deleteOne.name, deleteOne);
|
||||
register(StoreService.DeleteMany, deleteMany.name, deleteMany);
|
||||
register(StoreService.FindOne, findOne.name, findOne);
|
||||
register(StoreService.FindMany, findMany.name, findMany);
|
||||
|
||||
register(DataService.GetConversations, getConversations.name, getConversations);
|
||||
register(DataService.CreateConversation, createConversation.name, createConversation);
|
||||
register(DataService.UpdateConversation, updateConversation.name, updateConversation);
|
||||
register(DataService.UpdateMessage, updateMessage.name, updateMessage);
|
||||
register(DataService.DeleteConversation, deleteConversation.name, deleteConversation);
|
||||
register(DataService.CreateMessage, createMessage.name, createMessage);
|
||||
register(DataService.GetConversationMessages, getConversationMessages.name, getConversationMessages);
|
||||
}
|
||||
|
||||
function getConversations(): Promise<any> {
|
||||
return store.findMany("conversations", {}, [{ updatedAt: "desc" }]);
|
||||
}
|
||||
|
||||
function createConversation(conversation: any): Promise<number | undefined> {
|
||||
return store.insertOne("conversations", conversation);
|
||||
}
|
||||
|
||||
function updateConversation(conversation: any): Promise<void> {
|
||||
return store.updateOne("conversations", conversation._id, conversation);
|
||||
}
|
||||
|
||||
function createMessage(message: any): Promise<number | undefined> {
|
||||
return store.insertOne("messages", message);
|
||||
}
|
||||
|
||||
function updateMessage(message: any): Promise<void> {
|
||||
return store.updateOne("messages", message._id, message);
|
||||
}
|
||||
|
||||
function deleteConversation(id: any) {
|
||||
return store.deleteOne("conversations", id).then(() => store.deleteMany("messages", { conversationId: id }));
|
||||
}
|
||||
|
||||
function getConversationMessages(conversationId: any) {
|
||||
return store.findMany("messages", { conversationId }, [{ createdAt: "desc" }]);
|
||||
}
|
||||
|
||||
@ -1,412 +1,239 @@
|
||||
const sqlite3 = require("sqlite3").verbose();
|
||||
const path = require("path");
|
||||
const { app } = require("electron");
|
||||
var PouchDB = require("pouchdb-node");
|
||||
PouchDB.plugin(require("pouchdb-find"));
|
||||
var path = require("path");
|
||||
var { app } = require("electron");
|
||||
var fs = require("fs");
|
||||
|
||||
const MODEL_TABLE_CREATION = `
|
||||
CREATE TABLE IF NOT EXISTS models (
|
||||
id TEXT PRIMARY KEY,
|
||||
slug TEXT NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
avatar_url TEXT,
|
||||
long_description TEXT NOT NULL,
|
||||
technical_description TEXT NOT NULL,
|
||||
author TEXT NOT NULL,
|
||||
version TEXT NOT NULL,
|
||||
model_url TEXT NOT NULL,
|
||||
nsfw INTEGER NOT NULL,
|
||||
greeting TEXT NOT NULL,
|
||||
type TEXT NOT NULL,
|
||||
file_name TEXT NOT NULL,
|
||||
download_url TEXT NOT NULL,
|
||||
start_download_at INTEGER DEFAULT -1,
|
||||
finish_download_at INTEGER DEFAULT -1,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
);`;
|
||||
|
||||
const MODEL_TABLE_INSERTION = `
|
||||
INSERT INTO models (
|
||||
id,
|
||||
slug,
|
||||
name,
|
||||
description,
|
||||
avatar_url,
|
||||
long_description,
|
||||
technical_description,
|
||||
author,
|
||||
version,
|
||||
model_url,
|
||||
nsfw,
|
||||
greeting,
|
||||
type,
|
||||
file_name,
|
||||
download_url,
|
||||
start_download_at
|
||||
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`;
|
||||
|
||||
function init() {
|
||||
const db = new sqlite3.Database(path.join(app.getPath("userData"), "jan.db"));
|
||||
console.log(
|
||||
`Database located at ${path.join(app.getPath("userData"), "jan.db")}`
|
||||
);
|
||||
|
||||
db.serialize(() => {
|
||||
db.run(MODEL_TABLE_CREATION);
|
||||
db.run(
|
||||
"CREATE TABLE IF NOT EXISTS conversations ( id INTEGER PRIMARY KEY, name TEXT, model_id TEXT, image TEXT, message TEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP);"
|
||||
);
|
||||
db.run(
|
||||
"CREATE TABLE IF NOT EXISTS messages ( id INTEGER PRIMARY KEY, name TEXT, conversation_id INTEGER, user TEXT, message TEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP);"
|
||||
);
|
||||
});
|
||||
|
||||
db.close();
|
||||
}
|
||||
const dbs: Record<string, any> = {};
|
||||
|
||||
/**
|
||||
* Store a model in the database when user start downloading it
|
||||
* Create a collection on data store
|
||||
*
|
||||
* @param model Product
|
||||
*/
|
||||
function storeModel(model: any) {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
console.debug("Inserting", JSON.stringify(model));
|
||||
db.serialize(() => {
|
||||
const stmt = db.prepare(MODEL_TABLE_INSERTION);
|
||||
stmt.run(
|
||||
model.id,
|
||||
model.slug,
|
||||
model.name,
|
||||
model.description,
|
||||
model.avatarUrl,
|
||||
model.longDescription,
|
||||
model.technicalDescription,
|
||||
model.author,
|
||||
model.version,
|
||||
model.modelUrl,
|
||||
model.nsfw,
|
||||
model.greeting,
|
||||
model.type,
|
||||
model.fileName,
|
||||
model.downloadUrl,
|
||||
Date.now(),
|
||||
function (err: any) {
|
||||
if (err) {
|
||||
// Handle the insertion error here
|
||||
console.error(err.message);
|
||||
res(undefined);
|
||||
return;
|
||||
}
|
||||
// @ts-ignoreF
|
||||
const id = this.lastID;
|
||||
res(id);
|
||||
return;
|
||||
}
|
||||
);
|
||||
stmt.finalize();
|
||||
});
|
||||
|
||||
db.close();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the finished download time of a model
|
||||
* @param name name of the collection to create
|
||||
* @param schema schema of the collection to create, include fields and their types
|
||||
* @returns Promise<void>
|
||||
*
|
||||
* @param model Product
|
||||
*/
|
||||
function updateFinishedDownloadAt(fileName: string, time: number) {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
console.debug(`Updating fileName ${fileName} to ${time}`);
|
||||
const stmt = `UPDATE models SET finish_download_at = ? WHERE file_name = ?`;
|
||||
db.run(stmt, [time, fileName], (err: any) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log("Updated 1 row");
|
||||
res("Updated");
|
||||
}
|
||||
});
|
||||
|
||||
db.close();
|
||||
function createCollection(name: string, schema?: { [key: string]: any }): Promise<void> {
|
||||
return new Promise<void>((resolve) => {
|
||||
const dbPath = path.join(app.getPath("userData"), "databases");
|
||||
if (!fs.existsSync(dbPath)) fs.mkdirSync(dbPath);
|
||||
const db = new PouchDB(`${path.join(dbPath, name)}`);
|
||||
dbs[name] = db;
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all unfinished models from the database
|
||||
* Delete a collection
|
||||
*
|
||||
* @param name name of the collection to delete
|
||||
* @returns Promise<void>
|
||||
*
|
||||
*/
|
||||
function getUnfinishedDownloadModels() {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
function deleteCollection(name: string): Promise<void> {
|
||||
// Do nothing with Unstructured Database
|
||||
return dbs[name].destroy();
|
||||
}
|
||||
|
||||
const query = `SELECT * FROM models WHERE finish_download_at = -1 ORDER BY start_download_at DESC`;
|
||||
db.all(query, (err: Error, row: any) => {
|
||||
res(row);
|
||||
/**
|
||||
* Insert a value to a collection
|
||||
*
|
||||
* @param collectionName name of the collection
|
||||
* @param value value to insert
|
||||
* @returns Promise<any>
|
||||
*
|
||||
*/
|
||||
function insertOne(collectionName: string, value: any): Promise<any> {
|
||||
if (!value._id) return dbs[collectionName].post(value).then((doc) => doc.id);
|
||||
return dbs[collectionName].put(value).then((doc) => doc.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update value of a collection's record
|
||||
*
|
||||
* @param collectionName name of the collection
|
||||
* @param key key of the record to update
|
||||
* @param value value to update
|
||||
* @returns Promise<void>
|
||||
*
|
||||
*/
|
||||
function updateOne(collectionName: string, key: string, value: any): Promise<void> {
|
||||
console.debug(`updateOne ${collectionName}: ${key} - ${JSON.stringify(value)}`);
|
||||
return dbs[collectionName].get(key).then((doc) => {
|
||||
return dbs[collectionName].put({
|
||||
_id: key,
|
||||
_rev: doc._rev,
|
||||
...value,
|
||||
},
|
||||
{ force: true });
|
||||
}).then((res: any) => {
|
||||
console.info(`updateOne ${collectionName} result: ${JSON.stringify(res)}`);
|
||||
}).catch((err: any) => {
|
||||
console.error(`updateOne ${collectionName} error: ${err}`);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update value of a collection's records
|
||||
*
|
||||
* @param collectionName name of the collection
|
||||
* @param selector selector of records to update
|
||||
* @param value value to update
|
||||
* @returns Promise<void>
|
||||
*
|
||||
*/
|
||||
function updateMany(collectionName: string, value: any, selector?: { [key: string]: any }): Promise<any> {
|
||||
// Creates keys from selector for indexing
|
||||
const keys = selector ? Object.keys(selector) : [];
|
||||
|
||||
// At a basic level, there are two steps to running a query: createIndex()
|
||||
// (to define which fields to index) and find() (to query the index).
|
||||
return (
|
||||
keys.length > 0
|
||||
? dbs[collectionName].createIndex({
|
||||
// There is selector so we need to create index
|
||||
index: { fields: keys },
|
||||
})
|
||||
: Promise.resolve()
|
||||
) // No selector, so no need to create index
|
||||
.then(() =>
|
||||
dbs[collectionName].find({
|
||||
// Find documents using Mango queries
|
||||
selector,
|
||||
})
|
||||
)
|
||||
.then((data) => {
|
||||
const docs = data.docs.map((doc) => {
|
||||
// Update doc with new value
|
||||
return (doc = {
|
||||
...doc,
|
||||
...value,
|
||||
});
|
||||
});
|
||||
return dbs[collectionName].bulkDocs(docs);
|
||||
});
|
||||
db.close();
|
||||
});
|
||||
}
|
||||
|
||||
function getFinishedDownloadModels() {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
|
||||
const query = `SELECT * FROM models WHERE finish_download_at != -1 ORDER BY finish_download_at DESC`;
|
||||
db.all(query, (err: Error, row: any) => {
|
||||
res(row?.map((item: any) => parseToProduct(item)) ?? []);
|
||||
});
|
||||
db.close();
|
||||
});
|
||||
/**
|
||||
* Delete a collection's record
|
||||
*
|
||||
* @param collectionName name of the collection
|
||||
* @param key key of the record to delete
|
||||
* @returns Promise<void>
|
||||
*
|
||||
*/
|
||||
function deleteOne(collectionName: string, key: string): Promise<void> {
|
||||
return findOne(collectionName, key).then((doc) => dbs[collectionName].remove(doc));
|
||||
}
|
||||
|
||||
function deleteDownloadModel(modelId: string) {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
console.log(`Deleting ${modelId}`);
|
||||
db.serialize(() => {
|
||||
const stmt = db.prepare("DELETE FROM models WHERE id = ?");
|
||||
stmt.run(modelId);
|
||||
stmt.finalize();
|
||||
res(modelId);
|
||||
});
|
||||
/**
|
||||
* Delete a collection records by selector
|
||||
*
|
||||
* @param {string} collectionName name of the collection
|
||||
* @param {{ [key: string]: any }} selector selector for retrieving records.
|
||||
* @returns Promise<void>
|
||||
*
|
||||
*/
|
||||
function deleteMany(collectionName: string, selector?: { [key: string]: any }): Promise<void> {
|
||||
// Creates keys from selector for indexing
|
||||
const keys = selector ? Object.keys(selector) : [];
|
||||
|
||||
db.close();
|
||||
});
|
||||
}
|
||||
|
||||
function getModelById(modelId: string) {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
|
||||
console.debug("Get model by id", modelId);
|
||||
db.get(
|
||||
`SELECT * FROM models WHERE id = ?`,
|
||||
[modelId],
|
||||
(err: any, row: any) => {
|
||||
console.debug("Get model by id result", row);
|
||||
|
||||
if (row) {
|
||||
const product = {
|
||||
id: row.id,
|
||||
slug: row.slug,
|
||||
name: row.name,
|
||||
description: row.description,
|
||||
avatarUrl: row.avatar_url,
|
||||
longDescription: row.long_description,
|
||||
technicalDescription: row.technical_description,
|
||||
author: row.author,
|
||||
version: row.version,
|
||||
modelUrl: row.model_url,
|
||||
nsfw: row.nsfw,
|
||||
greeting: row.greeting,
|
||||
type: row.type,
|
||||
inputs: row.inputs,
|
||||
outputs: row.outputs,
|
||||
createdAt: new Date(row.created_at),
|
||||
updatedAt: new Date(row.updated_at),
|
||||
fileName: row.file_name,
|
||||
downloadUrl: row.download_url,
|
||||
};
|
||||
res(product);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
db.close();
|
||||
});
|
||||
}
|
||||
|
||||
function getConversations() {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
|
||||
db.all(
|
||||
"SELECT * FROM conversations ORDER BY updated_at DESC",
|
||||
(err: any, row: any) => {
|
||||
res(row);
|
||||
}
|
||||
);
|
||||
db.close();
|
||||
});
|
||||
}
|
||||
function storeConversation(conversation: any): Promise<number | undefined> {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
|
||||
db.serialize(() => {
|
||||
const stmt = db.prepare(
|
||||
"INSERT INTO conversations (name, model_id, image, message) VALUES (?, ?, ?, ?)"
|
||||
// At a basic level, there are two steps to running a query: createIndex()
|
||||
// (to define which fields to index) and find() (to query the index).
|
||||
return (
|
||||
keys.length > 0
|
||||
? dbs[collectionName].createIndex({
|
||||
// There is selector so we need to create index
|
||||
index: { fields: keys },
|
||||
})
|
||||
: Promise.resolve()
|
||||
) // No selector, so no need to create index
|
||||
.then(() =>
|
||||
dbs[collectionName].find({
|
||||
// Find documents using Mango queries
|
||||
selector,
|
||||
})
|
||||
)
|
||||
.then((data) => {
|
||||
return Promise.all(
|
||||
// Remove documents
|
||||
data.docs.map((doc) => {
|
||||
return dbs[collectionName].remove(doc);
|
||||
})
|
||||
);
|
||||
stmt.run(
|
||||
conversation.name,
|
||||
conversation.model_id,
|
||||
conversation.image,
|
||||
conversation.message,
|
||||
function (err: any) {
|
||||
if (err) {
|
||||
// Handle the insertion error here
|
||||
console.error(err.message);
|
||||
res(undefined);
|
||||
return;
|
||||
}
|
||||
// @ts-ignoreF
|
||||
const id = this.lastID;
|
||||
res(id);
|
||||
return;
|
||||
}
|
||||
);
|
||||
stmt.finalize();
|
||||
});
|
||||
|
||||
db.close();
|
||||
});
|
||||
}
|
||||
|
||||
function storeMessage(message: any): Promise<number | undefined> {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
|
||||
db.serialize(() => {
|
||||
const stmt = db.prepare(
|
||||
"INSERT INTO messages (name, conversation_id, user, message) VALUES (?, ?, ?, ?)"
|
||||
);
|
||||
stmt.run(
|
||||
message.name,
|
||||
message.conversation_id,
|
||||
message.user,
|
||||
message.message,
|
||||
function (err: any) {
|
||||
if (err) {
|
||||
// Handle the insertion error here
|
||||
console.error(err.message);
|
||||
res(undefined);
|
||||
return;
|
||||
}
|
||||
//@ts-ignore
|
||||
const id = this.lastID;
|
||||
res(id);
|
||||
return;
|
||||
}
|
||||
);
|
||||
stmt.finalize();
|
||||
});
|
||||
|
||||
db.close();
|
||||
});
|
||||
}
|
||||
function updateMessage(message: any): Promise<number | undefined> {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
|
||||
db.serialize(() => {
|
||||
const stmt = db.prepare(
|
||||
"UPDATE messages SET message = ?, updated_at = ? WHERE id = ?"
|
||||
);
|
||||
stmt.run(message.message, message.updated_at, message.id);
|
||||
stmt.finalize();
|
||||
res(message.id);
|
||||
});
|
||||
|
||||
db.close();
|
||||
});
|
||||
/**
|
||||
* Retrieve a record from a collection in the data store.
|
||||
* @param {string} collectionName - The name of the collection containing the record to retrieve.
|
||||
* @param {string} key - The key of the record to retrieve.
|
||||
* @returns {Promise<any>} A promise that resolves when the record is retrieved.
|
||||
*/
|
||||
function findOne(collectionName: string, key: string): Promise<any> {
|
||||
return dbs[collectionName].get(key).catch(() => undefined);
|
||||
}
|
||||
|
||||
function deleteConversation(id: any) {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
/**
|
||||
* Gets records in a collection in the data store using a selector.
|
||||
* @param {string} collectionName - The name of the collection containing records to retrieve.
|
||||
* @param {{ [key: string]: any }} selector - The selector to use to retrieve records.
|
||||
* @param {[{ [key: string]: any }]} sort - The sort options to use to retrieve records.
|
||||
* @returns {Promise<any>} A promise that resolves with the selected records.
|
||||
*/
|
||||
function findMany(
|
||||
collectionName: string,
|
||||
selector?: { [key: string]: any },
|
||||
sort?: [{ [key: string]: any }]
|
||||
): Promise<any> {
|
||||
const keys = selector ? Object.keys(selector) : [];
|
||||
const sortKeys = sort ? sort.flatMap((e) => (e ? Object.keys(e) : undefined)) : [];
|
||||
|
||||
db.serialize(() => {
|
||||
const deleteConv = db.prepare("DELETE FROM conversations WHERE id = ?");
|
||||
deleteConv.run(id);
|
||||
deleteConv.finalize();
|
||||
const deleteMessages = db.prepare(
|
||||
"DELETE FROM messages WHERE conversation_id = ?"
|
||||
);
|
||||
deleteMessages.run(id);
|
||||
deleteMessages.finalize();
|
||||
res(id);
|
||||
});
|
||||
|
||||
db.close();
|
||||
// Note that we are specifying that the field must be greater than or equal to null
|
||||
// which is a workaround for the fact that the Mango query language requires us to have a selector.
|
||||
// In CouchDB collation order, null is the "lowest" value, and so this will return all documents regardless of their field value.
|
||||
sortKeys.forEach((key) => {
|
||||
if (!keys.includes(key)) {
|
||||
selector = { ...selector, [key]: { $gt: null } };
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getConversationMessages(conversation_id: any) {
|
||||
return new Promise((res) => {
|
||||
const db = new sqlite3.Database(
|
||||
path.join(app.getPath("userData"), "jan.db")
|
||||
);
|
||||
|
||||
const query = `SELECT * FROM messages WHERE conversation_id = ${conversation_id} ORDER BY id DESC`;
|
||||
db.all(query, (err: Error, row: any) => {
|
||||
res(row);
|
||||
});
|
||||
db.close();
|
||||
});
|
||||
}
|
||||
|
||||
function parseToProduct(row: any) {
|
||||
const product = {
|
||||
id: row.id,
|
||||
slug: row.slug,
|
||||
name: row.name,
|
||||
description: row.description,
|
||||
avatarUrl: row.avatar_url,
|
||||
longDescription: row.long_description,
|
||||
technicalDescription: row.technical_description,
|
||||
author: row.author,
|
||||
version: row.version,
|
||||
modelUrl: row.model_url,
|
||||
nsfw: row.nsfw,
|
||||
greeting: row.greeting,
|
||||
type: row.type,
|
||||
inputs: row.inputs,
|
||||
outputs: row.outputs,
|
||||
createdAt: new Date(row.created_at),
|
||||
updatedAt: new Date(row.updated_at),
|
||||
fileName: row.file_name,
|
||||
downloadUrl: row.download_url,
|
||||
};
|
||||
return product;
|
||||
// There is no selector & sort, so we can just use allDocs() to get all the documents.
|
||||
if (sortKeys.concat(keys).length === 0) {
|
||||
return dbs[collectionName]
|
||||
.allDocs({
|
||||
include_docs: true,
|
||||
endkey: "_design",
|
||||
inclusive_end: false,
|
||||
})
|
||||
.then((data) => data.rows.map((row) => row.doc));
|
||||
}
|
||||
// At a basic level, there are two steps to running a query: createIndex()
|
||||
// (to define which fields to index) and find() (to query the index).
|
||||
return dbs[collectionName]
|
||||
.createIndex({
|
||||
// Create index for selector & sort
|
||||
index: { fields: sortKeys.concat(keys) },
|
||||
})
|
||||
.then(() => {
|
||||
// Find documents using Mango queries
|
||||
return dbs[collectionName].find({
|
||||
selector,
|
||||
sort,
|
||||
});
|
||||
})
|
||||
.then((data) => data.docs); // Return documents
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
init,
|
||||
getConversations,
|
||||
deleteConversation,
|
||||
storeConversation,
|
||||
storeMessage,
|
||||
updateMessage,
|
||||
getConversationMessages,
|
||||
storeModel,
|
||||
updateFinishedDownloadAt,
|
||||
getUnfinishedDownloadModels,
|
||||
getFinishedDownloadModels,
|
||||
deleteDownloadModel,
|
||||
getModelById,
|
||||
createCollection,
|
||||
deleteCollection,
|
||||
insertOne,
|
||||
findOne,
|
||||
findMany,
|
||||
updateOne,
|
||||
updateMany,
|
||||
deleteOne,
|
||||
deleteMany,
|
||||
};
|
||||
|
||||
2016
electron/core/plugins/data-plugin/package-lock.json
generated
@ -1,25 +1,27 @@
|
||||
{
|
||||
"name": "data-plugin",
|
||||
"version": "1.0.0",
|
||||
"description": "Jan Database Plugin efficiently stores conversation and model data using SQLite, providing accessible data management",
|
||||
"version": "1.0.4",
|
||||
"description": "The Data Connector provides easy access to a data API using the PouchDB engine. It offers accessible data management capabilities.",
|
||||
"icon": "https://raw.githubusercontent.com/tailwindlabs/heroicons/88e98b0c2b458553fbadccddc2d2f878edc0387b/src/20/solid/circle-stack.svg",
|
||||
"main": "dist/index.js",
|
||||
"main": "dist/esm/index.js",
|
||||
"author": "Jan",
|
||||
"license": "MIT",
|
||||
"activationPoints": [
|
||||
"init"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc -b . && webpack --config webpack.config.js",
|
||||
"postinstall": "rimraf ./data-plugin*.tgz && node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=darwin --target_libc=unknown --target_arch=x64 && node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=darwin --target_libc=unknown --target_arch=arm64 && node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --target_libc=glibc --target_arch=x64 && node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --target_libc=musl --target_arch=x64 && node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --target_libc=unknown --target_arch=x64 && npm run build",
|
||||
"build": "tsc --project ./config/tsconfig.esm.json && tsc --project ./config/tsconfig.cjs.json && webpack --config webpack.config.js",
|
||||
"postinstall": "rimraf ./data-plugin*.tgz && npm run build",
|
||||
"build:publish": "npm pack && cpx *.tgz ../../pre-install"
|
||||
},
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./main": "./dist/module.js"
|
||||
"import": "./dist/esm/index.js",
|
||||
"require": "./dist/cjs/module.js",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cpx": "^1.5.0",
|
||||
"node-pre-gyp": "^0.17.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-loader": "^9.4.4",
|
||||
"ts-node": "^10.9.1",
|
||||
@ -28,8 +30,8 @@
|
||||
"webpack-cli": "^5.1.4"
|
||||
},
|
||||
"bundledDependencies": [
|
||||
"sql.js",
|
||||
"sqlite3"
|
||||
"pouchdb-node",
|
||||
"pouchdb-find"
|
||||
],
|
||||
"files": [
|
||||
"dist/**",
|
||||
@ -37,7 +39,8 @@
|
||||
"node_modules"
|
||||
],
|
||||
"dependencies": {
|
||||
"node-pre-gyp": "^0.17.0",
|
||||
"sqlite3": "^5.1.6"
|
||||
"@janhq/plugin-core": "file:../../../../plugin-core",
|
||||
"pouchdb-find": "^8.0.1",
|
||||
"pouchdb-node": "^8.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,22 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||
/* Language and Environment */
|
||||
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
||||
/* Modules */
|
||||
"module": "ES6" /* Specify what module code is generated. */,
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
// "baseUrl": "." /* Specify the base directory to resolve non-relative module names. */,
|
||||
// "paths": {} /* Specify a set of entries that re-map imports to additional lookup locations. */,
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
// "resolveJsonModule": true, /* Enable importing .json files. */
|
||||
|
||||
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
||||
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
||||
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
||||
/* Type Checking */
|
||||
"strict": false /* Enable all strict type-checking options. */,
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
"target": "es2016",
|
||||
"module": "ES6",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "./dist",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": false,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,12 +14,15 @@ module.exports = {
|
||||
],
|
||||
},
|
||||
output: {
|
||||
filename: "index.js", // Adjust the output file name as needed
|
||||
filename: "esm/index.js", // Adjust the output file name as needed
|
||||
path: path.resolve(__dirname, "dist"),
|
||||
library: { type: "module" }, // Specify ESM output format
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".ts", ".js"],
|
||||
},
|
||||
optimization: {
|
||||
minimize: false
|
||||
},
|
||||
// Add loaders and other configuration as needed for your project
|
||||
};
|
||||
|
||||
@ -9,14 +9,6 @@ const initModel = async (product) =>
|
||||
}
|
||||
});
|
||||
|
||||
const dispose = async () =>
|
||||
new Promise(async (resolve) => {
|
||||
if (window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "dispose")
|
||||
.then((res) => resolve(res));
|
||||
}
|
||||
});
|
||||
const inferenceUrl = () => "http://localhost:3928/llama/chat_completion";
|
||||
|
||||
const stopModel = () => {
|
||||
@ -27,6 +19,5 @@ const stopModel = () => {
|
||||
export function init({ register }) {
|
||||
register("initModel", "initModel", initModel);
|
||||
register("inferenceUrl", "inferenceUrl", inferenceUrl);
|
||||
register("dispose", "dispose", dispose);
|
||||
register("stopModel", "stopModel", stopModel);
|
||||
}
|
||||
@ -1,102 +0,0 @@
|
||||
const path = require("path");
|
||||
const { app, dialog } = require("electron");
|
||||
const { spawn } = require("child_process");
|
||||
const fs = require("fs");
|
||||
|
||||
let subprocess = null;
|
||||
|
||||
async function initModel(product) {
|
||||
// fileName fallback
|
||||
if (!product.fileName) {
|
||||
product.fileName = product.file_name;
|
||||
}
|
||||
|
||||
if (!product.fileName) {
|
||||
await dialog.showMessageBox({
|
||||
message: "Selected model does not have file name..",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (subprocess) {
|
||||
console.error(
|
||||
"A subprocess is already running. Attempt to kill then reinit."
|
||||
);
|
||||
dispose();
|
||||
}
|
||||
|
||||
let binaryFolder = path.join(__dirname, "nitro"); // Current directory by default
|
||||
|
||||
// Read the existing config
|
||||
const configFilePath = path.join(binaryFolder, "config", "config.json");
|
||||
let config = {};
|
||||
if (fs.existsSync(configFilePath)) {
|
||||
const rawData = fs.readFileSync(configFilePath, "utf-8");
|
||||
config = JSON.parse(rawData);
|
||||
}
|
||||
|
||||
// Update the llama_model_path
|
||||
if (!config.custom_config) {
|
||||
config.custom_config = {};
|
||||
}
|
||||
|
||||
const modelPath = path.join(app.getPath("userData"), product.fileName);
|
||||
|
||||
config.custom_config.llama_model_path = modelPath;
|
||||
|
||||
// Write the updated config back to the file
|
||||
fs.writeFileSync(configFilePath, JSON.stringify(config, null, 4));
|
||||
|
||||
let binaryName;
|
||||
|
||||
if (process.platform === "win32") {
|
||||
binaryName = "nitro_windows_amd64.exe";
|
||||
} else if (process.platform === "darwin") { // Mac OS platform
|
||||
binaryName = process.arch === "arm64" ? "nitro_mac_arm64" : "nitro_mac_amd64";
|
||||
} else {
|
||||
// Linux
|
||||
binaryName = "nitro_linux_amd64_cuda"; // For other platforms
|
||||
}
|
||||
|
||||
const binaryPath = path.join(binaryFolder, binaryName);
|
||||
|
||||
// Execute the binary
|
||||
|
||||
subprocess = spawn(binaryPath, [configFilePath], { cwd: binaryFolder });
|
||||
|
||||
// Handle subprocess output
|
||||
subprocess.stdout.on("data", (data) => {
|
||||
console.log(`stdout: ${data}`);
|
||||
});
|
||||
|
||||
subprocess.stderr.on("data", (data) => {
|
||||
console.error(`stderr: ${data}`);
|
||||
});
|
||||
|
||||
subprocess.on("close", (code) => {
|
||||
console.log(`child process exited with code ${code}`);
|
||||
subprocess = null;
|
||||
});
|
||||
}
|
||||
|
||||
function dispose() {
|
||||
killSubprocess();
|
||||
// clean other registered resources here
|
||||
}
|
||||
|
||||
function killSubprocess() {
|
||||
if (subprocess) {
|
||||
subprocess.kill();
|
||||
subprocess = null;
|
||||
console.log("Subprocess terminated.");
|
||||
} else {
|
||||
console.error("No subprocess is currently running.");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
initModel,
|
||||
killSubprocess,
|
||||
dispose,
|
||||
};
|
||||
119
electron/core/plugins/inference-plugin/module.ts
Normal file
@ -0,0 +1,119 @@
|
||||
const path = require("path");
|
||||
const { app } = require("electron");
|
||||
const { spawn } = require("child_process");
|
||||
const fs = require("fs");
|
||||
const tcpPortUsed = require("tcp-port-used");
|
||||
const { killPortProcess } = require("kill-port-process");
|
||||
|
||||
let subprocess = null;
|
||||
const PORT = 3928;
|
||||
|
||||
const initModel = (fileName) => {
|
||||
return (
|
||||
new Promise<void>(async (resolve, reject) => {
|
||||
if (!fileName) {
|
||||
reject("Model not found, please download again.");
|
||||
}
|
||||
if (subprocess) {
|
||||
console.error(
|
||||
"A subprocess is already running. Attempt to kill then reinit."
|
||||
);
|
||||
killSubprocess();
|
||||
}
|
||||
resolve(fileName);
|
||||
})
|
||||
// Kill port process if it is already in use
|
||||
.then((fileName) =>
|
||||
tcpPortUsed
|
||||
.waitUntilFree(PORT, 200, 3000)
|
||||
.catch(() => killPortProcess(PORT))
|
||||
.then(() => fileName)
|
||||
)
|
||||
// Spawn Nitro subprocess to load model
|
||||
.then(() => {
|
||||
let binaryFolder = path.join(__dirname, "nitro"); // Current directory by default
|
||||
|
||||
// Read the existing config
|
||||
const configFilePath = path.join(binaryFolder, "config", "config.json");
|
||||
let config: any = {};
|
||||
if (fs.existsSync(configFilePath)) {
|
||||
const rawData = fs.readFileSync(configFilePath, "utf-8");
|
||||
config = JSON.parse(rawData);
|
||||
}
|
||||
|
||||
// Update the llama_model_path
|
||||
if (!config.custom_config) {
|
||||
config.custom_config = {};
|
||||
}
|
||||
|
||||
const modelPath = path.join(app.getPath("userData"), fileName);
|
||||
|
||||
config.custom_config.llama_model_path = modelPath;
|
||||
|
||||
// Write the updated config back to the file
|
||||
fs.writeFileSync(configFilePath, JSON.stringify(config, null, 4));
|
||||
|
||||
let binaryName;
|
||||
|
||||
if (process.platform === "win32") {
|
||||
binaryName = "nitro_windows_amd64.exe";
|
||||
} else if (process.platform === "darwin") {
|
||||
// Mac OS platform
|
||||
binaryName =
|
||||
process.arch === "arm64" ? "nitro_mac_arm64" : "nitro_mac_amd64";
|
||||
} else {
|
||||
// Linux
|
||||
binaryName = "nitro_linux_amd64_cuda"; // For other platforms
|
||||
}
|
||||
|
||||
const binaryPath = path.join(binaryFolder, binaryName);
|
||||
|
||||
// Execute the binary
|
||||
|
||||
subprocess = spawn(binaryPath, [configFilePath], { cwd: binaryFolder });
|
||||
|
||||
// Handle subprocess output
|
||||
subprocess.stdout.on("data", (data) => {
|
||||
console.log(`stdout: ${data}`);
|
||||
});
|
||||
|
||||
subprocess.stderr.on("data", (data) => {
|
||||
console.error(`stderr: ${data}`);
|
||||
});
|
||||
|
||||
subprocess.on("close", (code) => {
|
||||
console.log(`child process exited with code ${code}`);
|
||||
subprocess = null;
|
||||
});
|
||||
})
|
||||
.then(() => tcpPortUsed.waitUntilUsed(PORT, 300, 30000))
|
||||
.then(() => {
|
||||
return {};
|
||||
})
|
||||
.catch((err) => {
|
||||
return { error: err };
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
function dispose() {
|
||||
killSubprocess();
|
||||
// clean other registered resources here
|
||||
}
|
||||
|
||||
function killSubprocess() {
|
||||
if (subprocess) {
|
||||
subprocess.kill();
|
||||
subprocess = null;
|
||||
console.log("Subprocess terminated.");
|
||||
} else {
|
||||
killPortProcess(PORT);
|
||||
console.error("No subprocess is currently running.");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
initModel,
|
||||
killSubprocess,
|
||||
dispose,
|
||||
};
|
||||
595
electron/core/plugins/inference-plugin/package-lock.json
generated
@ -10,23 +10,29 @@
|
||||
"init"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "webpack --config webpack.config.js",
|
||||
"postinstall": "rimraf ./*.tgz && npm run build && cpx \"module.js\" \"dist\" && rimraf dist/nitro/* && cpx \"nitro/**\" \"dist/nitro\"",
|
||||
"build": "tsc -b . && webpack --config webpack.config.js",
|
||||
"postinstall": "rimraf ./*.tgz && npm run build && rimraf dist/nitro/* && cpx \"nitro/**\" \"dist/nitro\"",
|
||||
"build:publish": "npm pack && cpx *.tgz ../../pre-install"
|
||||
},
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./main": "./dist/module.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cpx": "^1.5.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"webpack": "^5.88.2",
|
||||
"webpack-cli": "^5.1.4"
|
||||
},
|
||||
"bundledDependencies": [
|
||||
"electron-is-dev",
|
||||
"node-llama-cpp"
|
||||
],
|
||||
"dependencies": {
|
||||
"electron-is-dev": "^2.0.0"
|
||||
"kill-port-process": "^3.2.0",
|
||||
"tcp-port-used": "^1.0.2",
|
||||
"ts-loader": "^9.5.0"
|
||||
},
|
||||
"bundledDependencies": [
|
||||
"tcp-port-used",
|
||||
"kill-port-process"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
|
||||
22
electron/core/plugins/inference-plugin/tsconfig.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||
/* Language and Environment */
|
||||
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
||||
/* Modules */
|
||||
"module": "ES6" /* Specify what module code is generated. */,
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
// "baseUrl": "." /* Specify the base directory to resolve non-relative module names. */,
|
||||
// "paths": {} /* Specify a set of entries that re-map imports to additional lookup locations. */,
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
// "resolveJsonModule": true, /* Enable importing .json files. */
|
||||
|
||||
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
||||
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
||||
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
||||
/* Type Checking */
|
||||
"strict": false /* Enable all strict type-checking options. */,
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@ const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
experiments: { outputModule: true },
|
||||
entry: "./index.js", // Adjust the entry point to match your project's main file
|
||||
entry: "./index.ts", // Adjust the entry point to match your project's main file
|
||||
mode: "production",
|
||||
module: {
|
||||
rules: [
|
||||
@ -19,7 +19,7 @@ module.exports = {
|
||||
library: { type: "module" }, // Specify ESM output format
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".js"],
|
||||
extensions: [".ts", ".js"],
|
||||
},
|
||||
// Add loaders and other configuration as needed for your project
|
||||
};
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
const MODULE_PATH = "model-management-plugin/dist/module.js";
|
||||
|
||||
const getDownloadedModels = async () =>
|
||||
new Promise(async (resolve) => {
|
||||
if (window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "getDownloadedModels")
|
||||
.then((res) => resolve(res));
|
||||
}
|
||||
});
|
||||
|
||||
const getAvailableModels = async () =>
|
||||
new Promise(async (resolve) => {
|
||||
if (window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "getAvailableModels")
|
||||
.then((res) => resolve(res));
|
||||
}
|
||||
});
|
||||
|
||||
const downloadModel = async (product) =>
|
||||
new Promise(async (resolve) => {
|
||||
if (window && window.electronAPI) {
|
||||
window.electronAPI
|
||||
.downloadFile(product.downloadUrl, product.fileName)
|
||||
.then((res) => resolve(res));
|
||||
} else {
|
||||
resolve("-");
|
||||
}
|
||||
});
|
||||
|
||||
const deleteModel = async (path) =>
|
||||
new Promise(async (resolve) => {
|
||||
if (window.electronAPI) {
|
||||
console.debug(`Delete model model management plugin: ${path}`);
|
||||
const response = await window.electronAPI.deleteFile(path);
|
||||
resolve(response);
|
||||
}
|
||||
});
|
||||
|
||||
const searchModels = async (params) =>
|
||||
new Promise(async (resolve) => {
|
||||
if (window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "searchModels", params)
|
||||
.then((res) => resolve(res));
|
||||
}
|
||||
});
|
||||
|
||||
// Register all the above functions and objects with the relevant extension points
|
||||
export function init({ register }) {
|
||||
register("getDownloadedModels", "getDownloadedModels", getDownloadedModels);
|
||||
register("getAvailableModels", "getAvailableModels", getAvailableModels);
|
||||
register("downloadModel", "downloadModel", downloadModel);
|
||||
register("deleteModel", "deleteModel", deleteModel);
|
||||
register("searchModels", "searchModels", searchModels);
|
||||
}
|
||||
103
electron/core/plugins/model-management-plugin/index.ts
Normal file
@ -0,0 +1,103 @@
|
||||
import { ModelManagementService, RegisterExtensionPoint, core, store } from "@janhq/plugin-core";
|
||||
const MODULE_PATH = "model-management-plugin/dist/module.js";
|
||||
|
||||
const getDownloadedModels = () => core.invokePluginFunc(MODULE_PATH, "getDownloadedModels");
|
||||
|
||||
const getAvailableModels = () => core.invokePluginFunc(MODULE_PATH, "getAvailableModels");
|
||||
|
||||
const downloadModel = (product) => core.downloadFile(product.downloadUrl, product.fileName);
|
||||
|
||||
const deleteModel = (path) => core.deleteFile(path);
|
||||
|
||||
const searchModels = (params) => core.invokePluginFunc(MODULE_PATH, "searchModels", params);
|
||||
|
||||
const getConfiguredModels = () => core.invokePluginFunc(MODULE_PATH, "getConfiguredModels");
|
||||
|
||||
/**
|
||||
* Store a model in the database when user start downloading it
|
||||
*
|
||||
* @param model Product
|
||||
*/
|
||||
function storeModel(model: any) {
|
||||
return store.findOne("models", model._id).then((doc) => {
|
||||
if (doc) {
|
||||
return store.updateOne("models", model._id, model);
|
||||
} else {
|
||||
return store.insertOne("models", model);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the finished download time of a model
|
||||
*
|
||||
* @param model Product
|
||||
*/
|
||||
function updateFinishedDownloadAt(_id: string): Promise<any> {
|
||||
return store.updateMany("models", { _id }, { time: Date.now(), finishDownloadAt: 1 });
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all unfinished models from the database.
|
||||
*
|
||||
* @returns A promise that resolves with an array of unfinished models.
|
||||
*/
|
||||
function getUnfinishedDownloadModels(): Promise<any> {
|
||||
return store.findMany("models", { finishDownloadAt: -1 }, [{ startDownloadAt: "desc" }]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all finished models from the database.
|
||||
*
|
||||
* @returns A promise that resolves with an array of finished models.
|
||||
*/
|
||||
function getFinishedDownloadModels(): Promise<any> {
|
||||
return store.findMany("models", { finishDownloadAt: 1 });
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a model from the database.
|
||||
*
|
||||
* @param modelId The ID of the model to delete.
|
||||
* @returns A promise that resolves when the model is deleted.
|
||||
*/
|
||||
function deleteDownloadModel(modelId: string): Promise<any> {
|
||||
return store.deleteOne("models", modelId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a model from the database by ID.
|
||||
*
|
||||
* @param modelId The ID of the model to retrieve.
|
||||
* @returns A promise that resolves with the model.
|
||||
*/
|
||||
function getModelById(modelId: string): Promise<any> {
|
||||
return store.findOne("models", modelId);
|
||||
}
|
||||
|
||||
function onStart() {
|
||||
store.createCollection("models", {});
|
||||
}
|
||||
|
||||
// Register all the above functions and objects with the relevant extension points
|
||||
export function init({ register }: { register: RegisterExtensionPoint }) {
|
||||
onStart();
|
||||
|
||||
register(ModelManagementService.GetDownloadedModels, getDownloadedModels.name, getDownloadedModels);
|
||||
register(ModelManagementService.GetAvailableModels, getAvailableModels.name, getAvailableModels);
|
||||
register(ModelManagementService.DownloadModel, downloadModel.name, downloadModel);
|
||||
register(ModelManagementService.DeleteModel, deleteModel.name, deleteModel);
|
||||
register(ModelManagementService.SearchModels, searchModels.name, searchModels);
|
||||
register(ModelManagementService.GetConfiguredModels, getConfiguredModels.name, getConfiguredModels);
|
||||
|
||||
register(ModelManagementService.StoreModel, storeModel.name, storeModel);
|
||||
register(ModelManagementService.UpdateFinishedDownloadAt, updateFinishedDownloadAt.name, updateFinishedDownloadAt);
|
||||
register(
|
||||
ModelManagementService.GetUnfinishedDownloadModels,
|
||||
getUnfinishedDownloadModels.name,
|
||||
getUnfinishedDownloadModels
|
||||
);
|
||||
register(ModelManagementService.DeleteDownloadModel, deleteDownloadModel.name, deleteDownloadModel);
|
||||
register(ModelManagementService.GetModelById, getModelById.name, getModelById);
|
||||
register(ModelManagementService.GetFinishedDownloadModels, getFinishedDownloadModels.name, getFinishedDownloadModels);
|
||||
}
|
||||
@ -1,177 +0,0 @@
|
||||
const path = require("path");
|
||||
const { readdirSync, lstatSync } = require("fs");
|
||||
const { app } = require("electron");
|
||||
const { listModels, listFiles, fileDownloadInfo } = require("@huggingface/hub");
|
||||
|
||||
let modelsIterator = undefined;
|
||||
let currentSearchOwner = undefined;
|
||||
|
||||
const ALL_MODELS = [
|
||||
{
|
||||
id: "llama-2-7b-chat.Q4_K_M.gguf.bin",
|
||||
slug: "llama-2-7b-chat.Q4_K_M.gguf.bin",
|
||||
name: "Llama 2 7B Chat - GGUF",
|
||||
description: "medium, balanced quality - recommended",
|
||||
avatarUrl:
|
||||
"https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/6426d3f3a7723d62b53c259b/tvPikpAzKTKGN5wrpadOJ.jpeg?w=200&h=200&f=face",
|
||||
longDescription:
|
||||
"GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp. GGUF offers numerous advantages over GGML, such as better tokenisation, and support for special tokens. It is also supports metadata, and is designed to be extensible.",
|
||||
technicalDescription:
|
||||
'GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.',
|
||||
author: "The Bloke",
|
||||
version: "1.0.0",
|
||||
modelUrl: "https://google.com",
|
||||
nsfw: false,
|
||||
greeting: "Hello there",
|
||||
type: "LLM",
|
||||
inputs: undefined,
|
||||
outputs: undefined,
|
||||
createdAt: 0,
|
||||
updatedAt: undefined,
|
||||
fileName: "llama-2-7b-chat.Q4_K_M.gguf.bin",
|
||||
downloadUrl:
|
||||
"https://huggingface.co/TheBloke/Llama-2-7b-Chat-GGUF/resolve/main/llama-2-7b-chat.Q4_K_M.gguf",
|
||||
},
|
||||
{
|
||||
id: "llama-2-13b-chat.Q4_K_M.gguf",
|
||||
slug: "llama-2-13b-chat.Q4_K_M.gguf",
|
||||
name: "Llama 2 13B Chat - GGUF",
|
||||
description:
|
||||
"medium, balanced quality - not recommended for RAM 16GB and below",
|
||||
avatarUrl:
|
||||
"https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/6426d3f3a7723d62b53c259b/tvPikpAzKTKGN5wrpadOJ.jpeg?w=200&h=200&f=face",
|
||||
longDescription:
|
||||
"GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp. GGUF offers numerous advantages over GGML, such as better tokenisation, and support for special tokens. It is also supports metadata, and is designed to be extensible.",
|
||||
technicalDescription:
|
||||
'GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.',
|
||||
author: "The Bloke",
|
||||
version: "1.0.0",
|
||||
modelUrl: "https://google.com",
|
||||
nsfw: false,
|
||||
greeting: "Hello there",
|
||||
type: "LLM",
|
||||
inputs: undefined,
|
||||
outputs: undefined,
|
||||
createdAt: 0,
|
||||
updatedAt: undefined,
|
||||
fileName: "llama-2-13b-chat.Q4_K_M.gguf.bin",
|
||||
downloadUrl:
|
||||
"https://huggingface.co/TheBloke/Llama-2-13B-chat-GGUF/resolve/main/llama-2-13b-chat.Q4_K_M.gguf",
|
||||
},
|
||||
];
|
||||
|
||||
function getDownloadedModels() {
|
||||
const userDataPath = app.getPath("userData");
|
||||
|
||||
const allBinariesName = [];
|
||||
var files = readdirSync(userDataPath);
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
var filename = path.join(userDataPath, files[i]);
|
||||
var stat = lstatSync(filename);
|
||||
if (stat.isDirectory()) {
|
||||
// ignore
|
||||
} else if (filename.endsWith(".bin")) {
|
||||
var binaryName = path.basename(filename);
|
||||
allBinariesName.push(binaryName);
|
||||
}
|
||||
}
|
||||
|
||||
const downloadedModels = ALL_MODELS.map((model) => {
|
||||
if (
|
||||
model.fileName &&
|
||||
allBinariesName
|
||||
.map((t) => t.toLowerCase())
|
||||
.includes(model.fileName.toLowerCase())
|
||||
) {
|
||||
return model;
|
||||
}
|
||||
return undefined;
|
||||
}).filter((m) => m !== undefined);
|
||||
|
||||
return downloadedModels;
|
||||
}
|
||||
|
||||
const getNextModels = async (count) => {
|
||||
const models = [];
|
||||
let hasMore = true;
|
||||
|
||||
while (models.length < count) {
|
||||
const next = await modelsIterator.next();
|
||||
|
||||
// end if we reached the end
|
||||
if (next.done) {
|
||||
hasMore = false;
|
||||
break;
|
||||
}
|
||||
|
||||
const model = next.value;
|
||||
const files = await listFilesByName(model.name);
|
||||
|
||||
models.push({
|
||||
...model,
|
||||
files,
|
||||
});
|
||||
}
|
||||
|
||||
const result = {
|
||||
data: models,
|
||||
hasMore,
|
||||
};
|
||||
return result;
|
||||
};
|
||||
|
||||
const searchModels = async (params) => {
|
||||
if (currentSearchOwner === params.search.owner && modelsIterator != null) {
|
||||
// paginated search
|
||||
console.debug(`Paginated search owner: ${params.search.owner}`);
|
||||
const models = await getNextModels(params.limit);
|
||||
return models;
|
||||
} else {
|
||||
// new search
|
||||
console.debug(`Init new search owner: ${params.search.owner}`);
|
||||
currentSearchOwner = params.search.owner;
|
||||
modelsIterator = listModels({
|
||||
search: params.search,
|
||||
credentials: params.credentials,
|
||||
});
|
||||
|
||||
const models = await getNextModels(params.limit);
|
||||
return models;
|
||||
}
|
||||
};
|
||||
|
||||
const listFilesByName = async (modelName) => {
|
||||
const repo = { type: "model", name: modelName };
|
||||
const fileDownloadInfoMap = {};
|
||||
for await (const file of listFiles({
|
||||
repo: repo,
|
||||
})) {
|
||||
if (file.type === "file" && file.path.endsWith(".bin")) {
|
||||
const downloadInfo = await fileDownloadInfo({
|
||||
repo: repo,
|
||||
path: file.path,
|
||||
});
|
||||
fileDownloadInfoMap[file.path] = {
|
||||
...file,
|
||||
...downloadInfo,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return fileDownloadInfoMap;
|
||||
};
|
||||
|
||||
function getAvailableModels() {
|
||||
const downloadedModelIds = getDownloadedModels().map((model) => model.id);
|
||||
return ALL_MODELS.filter((model) => {
|
||||
if (!downloadedModelIds.includes(model.id)) {
|
||||
return model;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getDownloadedModels,
|
||||
getAvailableModels,
|
||||
searchModels,
|
||||
};
|
||||
212
electron/core/plugins/model-management-plugin/module.ts
Normal file
@ -0,0 +1,212 @@
|
||||
const { listModels, listFiles, fileDownloadInfo } = require("@huggingface/hub");
|
||||
const https = require("https");
|
||||
|
||||
let modelsIterator = undefined;
|
||||
let currentSearchOwner = undefined;
|
||||
|
||||
// Github API
|
||||
const githubHostName = "api.github.com";
|
||||
const githubHeaders = {
|
||||
"User-Agent": "node.js",
|
||||
Accept: "application/vnd.github.v3+json",
|
||||
};
|
||||
const githubPath = "/repos/janhq/models/contents";
|
||||
|
||||
const getNextModels = async (count) => {
|
||||
const models = [];
|
||||
let hasMore = true;
|
||||
|
||||
while (models.length < count) {
|
||||
const next = await modelsIterator.next();
|
||||
|
||||
// end if we reached the end
|
||||
if (next.done) {
|
||||
hasMore = false;
|
||||
break;
|
||||
}
|
||||
|
||||
const model = next.value;
|
||||
const files = await listFilesByName(model.name);
|
||||
|
||||
models.push({
|
||||
...model,
|
||||
files,
|
||||
});
|
||||
}
|
||||
|
||||
const result = {
|
||||
data: models,
|
||||
hasMore,
|
||||
};
|
||||
return result;
|
||||
};
|
||||
|
||||
const searchModels = async (params) => {
|
||||
if (currentSearchOwner === params.search.owner && modelsIterator != null) {
|
||||
// paginated search
|
||||
console.debug(`Paginated search owner: ${params.search.owner}`);
|
||||
const models = await getNextModels(params.limit);
|
||||
return models;
|
||||
} else {
|
||||
// new search
|
||||
console.debug(`Init new search owner: ${params.search.owner}`);
|
||||
currentSearchOwner = params.search.owner;
|
||||
modelsIterator = listModels({
|
||||
search: params.search,
|
||||
credentials: params.credentials,
|
||||
});
|
||||
|
||||
const models = await getNextModels(params.limit);
|
||||
return models;
|
||||
}
|
||||
};
|
||||
|
||||
const listFilesByName = async (modelName) => {
|
||||
const repo = { type: "model", name: modelName };
|
||||
const fileDownloadInfoMap = {};
|
||||
for await (const file of listFiles({
|
||||
repo: repo,
|
||||
})) {
|
||||
if (file.type === "file" && file.path.endsWith(".bin")) {
|
||||
const downloadInfo = await fileDownloadInfo({
|
||||
repo: repo,
|
||||
path: file.path,
|
||||
});
|
||||
fileDownloadInfoMap[file.path] = {
|
||||
...file,
|
||||
...downloadInfo,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return fileDownloadInfoMap;
|
||||
};
|
||||
|
||||
async function getConfiguredModels() {
|
||||
const files: any = await getModelFiles();
|
||||
|
||||
const promises = files.map((file) => getContent(file));
|
||||
const response = await Promise.all(promises);
|
||||
|
||||
const models = [];
|
||||
response.forEach((model) => {
|
||||
models.push(parseToModel(model));
|
||||
});
|
||||
|
||||
return models;
|
||||
}
|
||||
|
||||
const parseToModel = (model) => {
|
||||
const modelVersions = [];
|
||||
model.versions.forEach((v) => {
|
||||
const version = {
|
||||
_id: `${model.author}-${v.name}`,
|
||||
name: v.name,
|
||||
quantMethod: v.quantMethod,
|
||||
bits: v.bits,
|
||||
size: v.size,
|
||||
maxRamRequired: v.maxRamRequired,
|
||||
usecase: v.usecase,
|
||||
downloadLink: v.downloadLink,
|
||||
productId: model.id,
|
||||
};
|
||||
modelVersions.push(version);
|
||||
});
|
||||
|
||||
const product = {
|
||||
_id: model.id,
|
||||
name: model.name,
|
||||
shortDescription: model.shortDescription,
|
||||
avatarUrl: model.avatarUrl,
|
||||
author: model.author,
|
||||
version: model.version,
|
||||
modelUrl: model.modelUrl,
|
||||
nsfw: model.nsfw,
|
||||
tags: model.tags,
|
||||
greeting: model.defaultGreeting,
|
||||
type: model.type,
|
||||
createdAt: model.createdAt,
|
||||
longDescription: model.longDescription,
|
||||
status: "Downloadable",
|
||||
releaseDate: 0,
|
||||
availableVersions: modelVersions,
|
||||
};
|
||||
return product;
|
||||
};
|
||||
|
||||
async function getModelFiles() {
|
||||
const options = {
|
||||
hostname: githubHostName,
|
||||
path: githubPath,
|
||||
headers: githubHeaders,
|
||||
};
|
||||
|
||||
const data = await new Promise((resolve, reject) => {
|
||||
const req = https.request(options, (res) => {
|
||||
let data = "";
|
||||
|
||||
res.on("data", (chunk) => {
|
||||
data += chunk;
|
||||
});
|
||||
|
||||
res.on("end", () => {
|
||||
const files = JSON.parse(data);
|
||||
|
||||
if (files.filter == null) {
|
||||
console.error(files.message);
|
||||
reject(files.message ?? "No files found");
|
||||
}
|
||||
if (!files || files.length === 0) {
|
||||
resolve([]);
|
||||
}
|
||||
const jsonFiles = files.filter((file) => file.name.endsWith(".json"));
|
||||
resolve(jsonFiles);
|
||||
});
|
||||
});
|
||||
|
||||
req.on("error", (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
req.end();
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
async function getContent(file) {
|
||||
const options = {
|
||||
hostname: githubHostName,
|
||||
path: `${githubPath}/${file.path}`,
|
||||
headers: githubHeaders,
|
||||
};
|
||||
|
||||
const data = await new Promise((resolve) => {
|
||||
const req = https.request(options, (res) => {
|
||||
let data = "";
|
||||
|
||||
res.on("data", (chunk) => {
|
||||
data += chunk;
|
||||
});
|
||||
|
||||
res.on("end", () => {
|
||||
const fileData = JSON.parse(data);
|
||||
const fileContent = Buffer.from(fileData.content, "base64").toString();
|
||||
resolve(JSON.parse(fileContent));
|
||||
});
|
||||
});
|
||||
|
||||
req.on("error", (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
req.end();
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
searchModels,
|
||||
getConfiguredModels,
|
||||
};
|
||||
@ -13,7 +13,9 @@
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@huggingface/hub": "^0.8.5"
|
||||
"@huggingface/hub": "^0.8.5",
|
||||
"@janhq/plugin-core": "file:../../../../plugin-core",
|
||||
"ts-loader": "^9.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cpx": "^1.5.0",
|
||||
@ -22,6 +24,14 @@
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
},
|
||||
"../../../../plugin-core": {
|
||||
"name": "@janhq/plugin-core",
|
||||
"version": "0.1.0",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@discoveryjs/json-ext": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz",
|
||||
@ -43,11 +53,14 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@janhq/plugin-core": {
|
||||
"resolved": "../../../../plugin-core",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
|
||||
"integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/set-array": "^1.0.1",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.10",
|
||||
@ -61,7 +74,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
|
||||
"integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
@ -70,7 +82,6 @@
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
|
||||
"integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
@ -79,7 +90,6 @@
|
||||
"version": "0.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz",
|
||||
"integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/gen-mapping": "^0.3.0",
|
||||
"@jridgewell/trace-mapping": "^0.3.9"
|
||||
@ -88,14 +98,12 @@
|
||||
"node_modules/@jridgewell/sourcemap-codec": {
|
||||
"version": "1.4.15",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
||||
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
|
||||
},
|
||||
"node_modules/@jridgewell/trace-mapping": {
|
||||
"version": "0.3.19",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz",
|
||||
"integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/resolve-uri": "^3.1.0",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||
@ -105,7 +113,6 @@
|
||||
"version": "8.44.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.3.tgz",
|
||||
"integrity": "sha512-iM/WfkwAhwmPff3wZuPLYiHX18HI24jU8k1ZSH7P8FHwxTjZ2P6CoX2wnF43oprR+YXJM6UUxATkNvyv/JHd+g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/estree": "*",
|
||||
"@types/json-schema": "*"
|
||||
@ -115,7 +122,6 @@
|
||||
"version": "3.7.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.5.tgz",
|
||||
"integrity": "sha512-JNvhIEyxVW6EoMIFIvj93ZOywYFatlpu9deeH6eSx6PE3WHYvHaQtmHmQeNw7aA81bYGBPPQqdtBm6b1SsQMmA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/eslint": "*",
|
||||
"@types/estree": "*"
|
||||
@ -124,26 +130,22 @@
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz",
|
||||
"integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA=="
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz",
|
||||
"integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ=="
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.8.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz",
|
||||
"integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==",
|
||||
"dev": true
|
||||
"integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w=="
|
||||
},
|
||||
"node_modules/@webassemblyjs/ast": {
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz",
|
||||
"integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/helper-numbers": "1.11.6",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.11.6"
|
||||
@ -152,26 +154,22 @@
|
||||
"node_modules/@webassemblyjs/floating-point-hex-parser": {
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz",
|
||||
"integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw=="
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-api-error": {
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz",
|
||||
"integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==",
|
||||
"dev": true
|
||||
"integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q=="
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-buffer": {
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz",
|
||||
"integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA=="
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-numbers": {
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz",
|
||||
"integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/floating-point-hex-parser": "1.11.6",
|
||||
"@webassemblyjs/helper-api-error": "1.11.6",
|
||||
@ -181,14 +179,12 @@
|
||||
"node_modules/@webassemblyjs/helper-wasm-bytecode": {
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz",
|
||||
"integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA=="
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-wasm-section": {
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz",
|
||||
"integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.6",
|
||||
"@webassemblyjs/helper-buffer": "1.11.6",
|
||||
@ -200,7 +196,6 @@
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz",
|
||||
"integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@xtuc/ieee754": "^1.2.0"
|
||||
}
|
||||
@ -209,7 +204,6 @@
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz",
|
||||
"integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@xtuc/long": "4.2.2"
|
||||
}
|
||||
@ -217,14 +211,12 @@
|
||||
"node_modules/@webassemblyjs/utf8": {
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz",
|
||||
"integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA=="
|
||||
},
|
||||
"node_modules/@webassemblyjs/wasm-edit": {
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz",
|
||||
"integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.6",
|
||||
"@webassemblyjs/helper-buffer": "1.11.6",
|
||||
@ -240,7 +232,6 @@
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz",
|
||||
"integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.6",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.11.6",
|
||||
@ -253,7 +244,6 @@
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz",
|
||||
"integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.6",
|
||||
"@webassemblyjs/helper-buffer": "1.11.6",
|
||||
@ -265,7 +255,6 @@
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz",
|
||||
"integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.6",
|
||||
"@webassemblyjs/helper-api-error": "1.11.6",
|
||||
@ -279,7 +268,6 @@
|
||||
"version": "1.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz",
|
||||
"integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.6",
|
||||
"@xtuc/long": "4.2.2"
|
||||
@ -332,20 +320,17 @@
|
||||
"node_modules/@xtuc/ieee754": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
|
||||
"integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA=="
|
||||
},
|
||||
"node_modules/@xtuc/long": {
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz",
|
||||
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.10.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz",
|
||||
"integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@ -357,7 +342,6 @@
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz",
|
||||
"integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==",
|
||||
"dev": true,
|
||||
"peerDependencies": {
|
||||
"acorn": "^8"
|
||||
}
|
||||
@ -366,7 +350,6 @@
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
@ -382,11 +365,24 @@
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
||||
"dev": true,
|
||||
"peerDependencies": {
|
||||
"ajv": "^6.9.1"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/anymatch": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz",
|
||||
@ -571,7 +567,6 @@
|
||||
"version": "4.22.1",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz",
|
||||
"integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@ -602,8 +597,7 @@
|
||||
"node_modules/buffer-from": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
|
||||
},
|
||||
"node_modules/cache-base": {
|
||||
"version": "1.0.1",
|
||||
@ -638,7 +632,6 @@
|
||||
"version": "1.0.30001543",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001543.tgz",
|
||||
"integrity": "sha512-qxdO8KPWPQ+Zk6bvNpPeQIOH47qZSYdFZd6dXQzb2KzhnSXju4Kd7H1PkSJx6NICSMgo/IhRZRhhfPTHYpJUCA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@ -654,6 +647,32 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk/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==",
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/chokidar": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
|
||||
@ -678,7 +697,6 @@
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz",
|
||||
"integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
}
|
||||
@ -802,6 +820,22 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
||||
},
|
||||
"node_modules/colorette": {
|
||||
"version": "2.0.20",
|
||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
|
||||
@ -811,8 +845,7 @@
|
||||
"node_modules/commander": {
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
|
||||
},
|
||||
"node_modules/component-emitter": {
|
||||
"version": "1.3.0",
|
||||
@ -934,14 +967,12 @@
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.4.542",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.542.tgz",
|
||||
"integrity": "sha512-6+cpa00G09N3sfh2joln4VUXHquWrOFx3FLZqiVQvl45+zS9DskDBTPvob+BhvFRmTBkyDSk0vvLMMRo/qc6mQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-6+cpa00G09N3sfh2joln4VUXHquWrOFx3FLZqiVQvl45+zS9DskDBTPvob+BhvFRmTBkyDSk0vvLMMRo/qc6mQ=="
|
||||
},
|
||||
"node_modules/enhanced-resolve": {
|
||||
"version": "5.15.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz",
|
||||
"integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
"tapable": "^2.2.0"
|
||||
@ -965,14 +996,12 @@
|
||||
"node_modules/es-module-lexer": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.1.tgz",
|
||||
"integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==",
|
||||
"dev": true
|
||||
"integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q=="
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
|
||||
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
@ -981,7 +1010,6 @@
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
||||
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esrecurse": "^4.3.0",
|
||||
"estraverse": "^4.1.1"
|
||||
@ -994,7 +1022,6 @@
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
|
||||
"integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"estraverse": "^5.2.0"
|
||||
},
|
||||
@ -1006,7 +1033,6 @@
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
|
||||
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
@ -1015,7 +1041,6 @@
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
||||
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
@ -1024,7 +1049,6 @@
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
|
||||
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.8.x"
|
||||
}
|
||||
@ -1093,14 +1117,12 @@
|
||||
"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
|
||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
|
||||
},
|
||||
"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",
|
||||
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
|
||||
},
|
||||
"node_modules/fastest-levenshtein": {
|
||||
"version": "1.0.16",
|
||||
@ -1274,8 +1296,7 @@
|
||||
"node_modules/glob-to-regexp": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
|
||||
"integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw=="
|
||||
},
|
||||
"node_modules/glob2base": {
|
||||
"version": "0.0.12",
|
||||
@ -1292,8 +1313,7 @@
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
|
||||
},
|
||||
"node_modules/has": {
|
||||
"version": "1.0.4",
|
||||
@ -1308,7 +1328,6 @@
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
@ -1669,7 +1688,6 @@
|
||||
"version": "27.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",
|
||||
"integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"merge-stream": "^2.0.0",
|
||||
@ -1682,14 +1700,12 @@
|
||||
"node_modules/json-parse-even-better-errors": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
|
||||
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
|
||||
"dev": true
|
||||
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
|
||||
},
|
||||
"node_modules/json-schema-traverse": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
||||
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
|
||||
},
|
||||
"node_modules/kind-of": {
|
||||
"version": "3.2.2",
|
||||
@ -1707,7 +1723,6 @@
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz",
|
||||
"integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.11.5"
|
||||
}
|
||||
@ -1724,6 +1739,17 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/map-cache": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
|
||||
@ -1754,8 +1780,7 @@
|
||||
"node_modules/merge-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
|
||||
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
|
||||
"dev": true
|
||||
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="
|
||||
},
|
||||
"node_modules/micromatch": {
|
||||
"version": "2.3.11",
|
||||
@ -1785,7 +1810,6 @@
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
@ -1794,7 +1818,6 @@
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"mime-db": "1.52.0"
|
||||
},
|
||||
@ -1925,14 +1948,12 @@
|
||||
"node_modules/neo-async": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
|
||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
|
||||
},
|
||||
"node_modules/node-releases": {
|
||||
"version": "2.0.13",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
|
||||
"integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ=="
|
||||
},
|
||||
"node_modules/normalize-path": {
|
||||
"version": "2.1.1",
|
||||
@ -2179,8 +2200,18 @@
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
|
||||
},
|
||||
"node_modules/picomatch": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||
"engines": {
|
||||
"node": ">=8.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/jonschlinkert"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg-dir": {
|
||||
"version": "4.2.0",
|
||||
@ -2222,7 +2253,6 @@
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
|
||||
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
@ -2263,7 +2293,6 @@
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.1.0"
|
||||
}
|
||||
@ -2743,7 +2772,6 @@
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
@ -2772,7 +2800,6 @@
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
|
||||
"integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.8",
|
||||
"ajv": "^6.12.5",
|
||||
@ -2786,11 +2813,24 @@
|
||||
"url": "https://opencollective.com/webpack"
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/serialize-javascript": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz",
|
||||
"integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"randombytes": "^2.1.0"
|
||||
}
|
||||
@ -3023,7 +3063,6 @@
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
@ -3046,7 +3085,6 @@
|
||||
"version": "0.5.21",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
|
||||
"integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"source-map": "^0.6.0"
|
||||
@ -3171,7 +3209,6 @@
|
||||
"version": "8.1.1",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
|
||||
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
@ -3198,7 +3235,6 @@
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
|
||||
"integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
@ -3207,7 +3243,6 @@
|
||||
"version": "5.21.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.21.0.tgz",
|
||||
"integrity": "sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/source-map": "^0.3.3",
|
||||
"acorn": "^8.8.2",
|
||||
@ -3225,7 +3260,6 @@
|
||||
"version": "5.3.9",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz",
|
||||
"integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "^0.3.17",
|
||||
"jest-worker": "^27.4.5",
|
||||
@ -3307,6 +3341,99 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-loader": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.0.tgz",
|
||||
"integrity": "sha512-LLlB/pkB4q9mW2yLdFMnK3dEHbrBjeZTYguaaIfusyojBgAGf5kF+O6KcWqiGzWqHk0LBsoolrp4VftEURhybg==",
|
||||
"dependencies": {
|
||||
"chalk": "^4.1.0",
|
||||
"enhanced-resolve": "^5.0.0",
|
||||
"micromatch": "^4.0.0",
|
||||
"semver": "^7.3.4",
|
||||
"source-map": "^0.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "*",
|
||||
"webpack": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-loader/node_modules/braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"dependencies": {
|
||||
"fill-range": "^7.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-loader/node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-loader/node_modules/is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-loader/node_modules/micromatch": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
||||
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
||||
"dependencies": {
|
||||
"braces": "^3.0.2",
|
||||
"picomatch": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.6"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-loader/node_modules/source-map": {
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz",
|
||||
"integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==",
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-loader/node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dependencies": {
|
||||
"is-number": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
|
||||
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/union-value": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
|
||||
@ -3383,7 +3510,6 @@
|
||||
"version": "1.0.13",
|
||||
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
|
||||
"integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@ -3413,7 +3539,6 @@
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
||||
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
@ -3444,7 +3569,6 @@
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
|
||||
"integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
"graceful-fs": "^4.1.2"
|
||||
@ -3457,7 +3581,6 @@
|
||||
"version": "5.88.2",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz",
|
||||
"integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/eslint-scope": "^3.7.3",
|
||||
"@types/estree": "^1.0.0",
|
||||
@ -3571,7 +3694,6 @@
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz",
|
||||
"integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
@ -3602,6 +3724,11 @@
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "model-management-plugin",
|
||||
"version": "1.0.0",
|
||||
"description": "Model Management Plugin leverages the HuggingFace API for model exploration and seamless downloads",
|
||||
"description": "Model Management Plugin provides model exploration and seamless downloads",
|
||||
"icon": "https://raw.githubusercontent.com/tailwindlabs/heroicons/88e98b0c2b458553fbadccddc2d2f878edc0387b/src/20/solid/queue-list.svg",
|
||||
"main": "dist/index.js",
|
||||
"author": "James",
|
||||
@ -10,8 +10,8 @@
|
||||
"init"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "webpack --config webpack.config.js",
|
||||
"postinstall": "rimraf ./*.tgz && npm run build && cpx \"module.js\" \"dist\"",
|
||||
"build": "tsc -b . && webpack --config webpack.config.js",
|
||||
"postinstall": "rimraf ./*.tgz && npm run build",
|
||||
"build:publish": "npm pack && cpx *.tgz ../../pre-install"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -26,7 +26,9 @@
|
||||
"README.md"
|
||||
],
|
||||
"dependencies": {
|
||||
"@huggingface/hub": "^0.8.5"
|
||||
"@huggingface/hub": "^0.8.5",
|
||||
"@janhq/plugin-core": "file:../../../../plugin-core",
|
||||
"ts-loader": "^9.5.0"
|
||||
},
|
||||
"bundledDependencies": [
|
||||
"@huggingface/hub"
|
||||
|
||||
12
electron/core/plugins/model-management-plugin/tsconfig.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2016",
|
||||
"module": "ES6",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "./dist",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": false,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@ const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
experiments: { outputModule: true },
|
||||
entry: "./index.js", // Adjust the entry point to match your project's main file
|
||||
entry: "./index.ts", // Adjust the entry point to match your project's main file
|
||||
mode: "production",
|
||||
module: {
|
||||
rules: [
|
||||
@ -19,7 +19,10 @@ module.exports = {
|
||||
library: { type: "module" }, // Specify ESM output format
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".js"],
|
||||
extensions: [".ts", ".js"],
|
||||
},
|
||||
optimization: {
|
||||
minimize: false
|
||||
},
|
||||
// Add loaders and other configuration as needed for your project
|
||||
};
|
||||
|
||||
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
@ -156,8 +156,23 @@ function handleIPCs() {
|
||||
|
||||
rmdir(fullPath, { recursive: true }, function (err) {
|
||||
if (err) console.log(err);
|
||||
app.relaunch();
|
||||
app.exit();
|
||||
dispose(requiredModules);
|
||||
|
||||
// just relaunch if packaged, should launch manually in development mode
|
||||
if (app.isPackaged) {
|
||||
app.relaunch();
|
||||
app.exit();
|
||||
} else {
|
||||
for (const modulePath in requiredModules) {
|
||||
delete require.cache[
|
||||
require.resolve(
|
||||
join(app.getPath("userData"), "plugins", modulePath)
|
||||
)
|
||||
];
|
||||
}
|
||||
setupPlugins();
|
||||
mainWindow?.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
{
|
||||
"name": "jan-electron",
|
||||
"name": "jan",
|
||||
"version": "0.1.3",
|
||||
"main": "./build/main.js",
|
||||
"author": "Jan <service@jan.ai>",
|
||||
"license": "MIT",
|
||||
"homepage": "./",
|
||||
"homepage": "https://github.com/janhq/jan/tree/main/electron",
|
||||
"description": "Use offline LLMs with your own data. Run open source models like Llama2 or Falcon on your internal computers/servers.",
|
||||
"build": {
|
||||
"appId": "jan.ai.app",
|
||||
"productName": "Jan",
|
||||
@ -32,7 +33,16 @@
|
||||
"entitlementsInherit": "./entitlements.mac.plist",
|
||||
"notarize": {
|
||||
"teamId": "YT49P7GXG4"
|
||||
}
|
||||
},
|
||||
"icon": "icons/icon.png"
|
||||
},
|
||||
"linux": {
|
||||
"target": ["deb"],
|
||||
"category": "Utility",
|
||||
"icon": "icons/"
|
||||
},
|
||||
"win": {
|
||||
"icon": "icons/icon.png"
|
||||
},
|
||||
"artifactName": "jan-${os}-${arch}-${version}.${ext}"
|
||||
},
|
||||
|
||||
@ -22,9 +22,9 @@ test.beforeAll(async () => {
|
||||
expect(appInfo.asar).toBe(true);
|
||||
expect(appInfo.executable).toBeTruthy();
|
||||
expect(appInfo.main).toBeTruthy();
|
||||
expect(appInfo.name).toBe("jan-electron");
|
||||
expect(appInfo.name).toBe("jan");
|
||||
expect(appInfo.packageJson).toBeTruthy();
|
||||
expect(appInfo.packageJson.name).toBe("jan-electron");
|
||||
expect(appInfo.packageJson.name).toBe("jan");
|
||||
expect(appInfo.platform).toBeTruthy();
|
||||
expect(appInfo.platform).toBe(process.platform);
|
||||
expect(appInfo.resourcesDir).toBeTruthy();
|
||||
|
||||
731
package-lock.json
generated
@ -27,27 +27,29 @@
|
||||
}
|
||||
},
|
||||
"electron": {
|
||||
"name": "jan-electron",
|
||||
"name": "jan",
|
||||
"version": "0.1.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@npmcli/arborist": "^7.1.0",
|
||||
"electron-mocha": "^12.1.0",
|
||||
"@uiball/loaders": "^1.3.0",
|
||||
"electron-store": "^8.1.0",
|
||||
"electron-updater": "^6.1.4",
|
||||
"pacote": "^17.0.4",
|
||||
"react-intersection-observer": "^9.5.2",
|
||||
"request": "^2.88.2",
|
||||
"request-progress": "^3.0.0"
|
||||
"request-progress": "^3.0.0",
|
||||
"use-debounce": "^9.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron/notarize": "^2.1.0",
|
||||
"@playwright/test": "^1.38.1",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
||||
"@typescript-eslint/parser": "^6.7.3",
|
||||
"electron": "26.2.1",
|
||||
"electron-builder": "^24.6.4",
|
||||
"electron-playwright-helpers": "^1.6.0",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"xvfb-maybe": "^0.2.1"
|
||||
"eslint-plugin-react": "^7.33.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@aashutoshrathi/word-wrap": {
|
||||
@ -324,6 +326,21 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/is-prop-valid": {
|
||||
"version": "0.8.8",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz",
|
||||
"integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@emotion/memoize": "0.7.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/memoize": {
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz",
|
||||
"integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/@eslint-community/eslint-utils": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
|
||||
@ -557,6 +574,10 @@
|
||||
"integrity": "sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@janhq/plugin-core": {
|
||||
"resolved": "plugin-core",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
|
||||
@ -711,6 +732,126 @@
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-darwin-x64": {
|
||||
"version": "13.4.10",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.10.tgz",
|
||||
"integrity": "sha512-ngXhUBbcZIWZWqNbQSNxQrB9T1V+wgfCzAor2olYuo/YpaL6mUYNUEgeBMhr8qwV0ARSgKaOp35lRvB7EmCRBg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-gnu": {
|
||||
"version": "13.4.10",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.10.tgz",
|
||||
"integrity": "sha512-SjCZZCOmHD4uyM75MVArSAmF5Y+IJSGroPRj2v9/jnBT36SYFTORN8Ag/lhw81W9EeexKY/CUg2e9mdebZOwsg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-musl": {
|
||||
"version": "13.4.10",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.10.tgz",
|
||||
"integrity": "sha512-F+VlcWijX5qteoYIOxNiBbNE8ruaWuRlcYyIRK10CugqI/BIeCDzEDyrHIHY8AWwbkTwe6GRHabMdE688Rqq4Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-gnu": {
|
||||
"version": "13.4.10",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.10.tgz",
|
||||
"integrity": "sha512-WDv1YtAV07nhfy3i1visr5p/tjiH6CeXp4wX78lzP1jI07t4PnHHG1WEDFOduXh3WT4hG6yN82EQBQHDi7hBrQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-musl": {
|
||||
"version": "13.4.10",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.10.tgz",
|
||||
"integrity": "sha512-zFkzqc737xr6qoBgDa3AwC7jPQzGLjDlkNmt/ljvQJ/Veri5ECdHjZCUuiTUfVjshNIIpki6FuP0RaQYK9iCRg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-arm64-msvc": {
|
||||
"version": "13.4.10",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.10.tgz",
|
||||
"integrity": "sha512-IboRS8IWz5mWfnjAdCekkl8s0B7ijpWeDwK2O8CdgZkoCDY0ZQHBSGiJ2KViAG6+BJVfLvcP+a2fh6cdyBr9QQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-ia32-msvc": {
|
||||
"version": "13.4.10",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.10.tgz",
|
||||
"integrity": "sha512-bSA+4j8jY4EEiwD/M2bol4uVEu1lBlgsGdvM+mmBm/BbqofNBfaZ2qwSbwE2OwbAmzNdVJRFRXQZ0dkjopTRaQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-x64-msvc": {
|
||||
"version": "13.4.10",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.10.tgz",
|
||||
"integrity": "sha512-g2+tU63yTWmcVQKDGY0MV1PjjqgZtwM4rB1oVVi/v0brdZAcrcTV+04agKzWtvWroyFz6IqtT0MoZJA7PNyLVw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodelib/fs.scandir": {
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
||||
@ -1666,6 +1807,15 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@uiball/loaders": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@uiball/loaders/-/loaders-1.3.0.tgz",
|
||||
"integrity": "sha512-w372e7PMt/s6LZ321HoghgDDU8fomamAzJfrVAdBUhsWERJEpxJMqG37NFztUq/T4J7nzzjkvZI4UX7Z2F/O6A==",
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@xmldom/xmldom": {
|
||||
"version": "0.8.10",
|
||||
"resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz",
|
||||
@ -1788,14 +1938,6 @@
|
||||
"ajv": "^6.9.1"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-colors": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
|
||||
"integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
@ -2610,11 +2752,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/browser-stdout": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
|
||||
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw=="
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
"version": "4.22.1",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz",
|
||||
@ -2856,17 +2993,6 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/camelcase": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
|
||||
"integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/camelcase-css": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz",
|
||||
@ -3104,6 +3230,7 @@
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
||||
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"string-width": "^4.2.0",
|
||||
@ -3607,17 +3734,6 @@
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/decamelize": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz",
|
||||
"integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/decode-named-character-reference": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz",
|
||||
@ -4070,38 +4186,6 @@
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-mocha": {
|
||||
"version": "12.1.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-mocha/-/electron-mocha-12.1.0.tgz",
|
||||
"integrity": "sha512-9ZIvyHGbet4ZtvF2NYYjGm7/yPljnTxbHo8psVX/HQAFPp9vZE0mCNWlzwE42keq/42gBW6W40MtKmgn1v42hQ==",
|
||||
"dependencies": {
|
||||
"ansi-colors": "^4.1.1",
|
||||
"electron-window": "^0.8.0",
|
||||
"mocha": "^10.2.0",
|
||||
"which": "^3.0.0",
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
"bin": {
|
||||
"electron-mocha": "bin/electron-mocha"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-mocha/node_modules/which": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz",
|
||||
"integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==",
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"node-which": "bin/which.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-playwright-helpers": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-playwright-helpers/-/electron-playwright-helpers-1.6.0.tgz",
|
||||
@ -4163,14 +4247,6 @@
|
||||
"tiny-typed-emitter": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-window": {
|
||||
"version": "0.8.1",
|
||||
"resolved": "https://registry.npmjs.org/electron-window/-/electron-window-0.8.1.tgz",
|
||||
"integrity": "sha512-W1i9LfnZJozk3MXE8VgsL2E5wOUHSgyCvcg1H2vQQjj+gqhO9lVudgY3z3SF7LJAmi+0vy3CJkbMqsynWB49EA==",
|
||||
"dependencies": {
|
||||
"is-electron-renderer": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron/node_modules/@types/node": {
|
||||
"version": "18.18.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.3.tgz",
|
||||
@ -5250,14 +5326,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/flat": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz",
|
||||
"integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",
|
||||
"bin": {
|
||||
"flat": "cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/flat-cache": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz",
|
||||
@ -5405,6 +5473,29 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/framer-motion": {
|
||||
"version": "10.16.4",
|
||||
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-10.16.4.tgz",
|
||||
"integrity": "sha512-p9V9nGomS3m6/CALXqv6nFGMuFOxbWsmaOrdmhyQimMIlLl3LC7h7l86wge/Js/8cRu5ktutS/zlzgR7eBOtFA==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@emotion/is-prop-valid": "^0.8.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/fs-extra": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
||||
@ -5512,6 +5603,7 @@
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": "6.* || 8.* || >= 10.*"
|
||||
@ -6175,14 +6267,6 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/he": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
|
||||
"bin": {
|
||||
"he": "bin/he"
|
||||
}
|
||||
},
|
||||
"node_modules/highlight.js": {
|
||||
"version": "10.7.3",
|
||||
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz",
|
||||
@ -6710,11 +6794,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-electron-renderer": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-electron-renderer/-/is-electron-renderer-2.0.1.tgz",
|
||||
"integrity": "sha512-pRlQnpaCFhDVPtkXkP+g9Ybv/CjbiQDjnKFQTEjpBfDKeV6dRDBczuFRDpM6DVfk2EjpMS8t5kwE5jPnqYl3zA=="
|
||||
},
|
||||
"node_modules/is-equal-shallow": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz",
|
||||
@ -7021,17 +7100,6 @@
|
||||
"integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/is-unicode-supported": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
|
||||
"integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-weakmap": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz",
|
||||
@ -7168,7 +7236,7 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/jan-electron": {
|
||||
"node_modules/jan": {
|
||||
"resolved": "electron",
|
||||
"link": true
|
||||
},
|
||||
@ -7506,9 +7574,7 @@
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
},
|
||||
"node_modules/lodash.castarray": {
|
||||
"version": "4.4.0",
|
||||
@ -7540,21 +7606,6 @@
|
||||
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/log-symbols": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
|
||||
"integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",
|
||||
"dependencies": {
|
||||
"chalk": "^4.1.0",
|
||||
"is-unicode-supported": "^0.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/longest-streak": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz",
|
||||
@ -7655,6 +7706,25 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/marked": {
|
||||
"version": "9.1.2",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-9.1.2.tgz",
|
||||
"integrity": "sha512-qoKMJqK0w6vkLk8+KnKZAH6neUZSNaQqVZ/h2yZ9S7CbLuFHyS2viB0jnqcWF9UKjwsAbMrQtnQhdmdvOVOw9w==",
|
||||
"bin": {
|
||||
"marked": "bin/marked.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
}
|
||||
},
|
||||
"node_modules/marked-highlight": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/marked-highlight/-/marked-highlight-2.0.6.tgz",
|
||||
"integrity": "sha512-xjA/C6xgXAfkkYg+YHnxdjmgFyTDtqqu8KbZiqh+COJ7PuzR15kqa+rPrs6pf/2jExXtG1jyCFUHmv9s0Bi/dQ==",
|
||||
"peerDependencies": {
|
||||
"marked": ">=4 <10"
|
||||
}
|
||||
},
|
||||
"node_modules/matcher": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
|
||||
@ -8552,249 +8622,6 @@
|
||||
"mkdirp": "bin/cmd.js"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha": {
|
||||
"version": "10.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz",
|
||||
"integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==",
|
||||
"dependencies": {
|
||||
"ansi-colors": "4.1.1",
|
||||
"browser-stdout": "1.3.1",
|
||||
"chokidar": "3.5.3",
|
||||
"debug": "4.3.4",
|
||||
"diff": "5.0.0",
|
||||
"escape-string-regexp": "4.0.0",
|
||||
"find-up": "5.0.0",
|
||||
"glob": "7.2.0",
|
||||
"he": "1.2.0",
|
||||
"js-yaml": "4.1.0",
|
||||
"log-symbols": "4.1.0",
|
||||
"minimatch": "5.0.1",
|
||||
"ms": "2.1.3",
|
||||
"nanoid": "3.3.3",
|
||||
"serialize-javascript": "6.0.0",
|
||||
"strip-json-comments": "3.1.1",
|
||||
"supports-color": "8.1.1",
|
||||
"workerpool": "6.2.1",
|
||||
"yargs": "16.2.0",
|
||||
"yargs-parser": "20.2.4",
|
||||
"yargs-unparser": "2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"_mocha": "bin/_mocha",
|
||||
"mocha": "bin/mocha.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/mochajs"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/ansi-colors": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
|
||||
"integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/anymatch": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
|
||||
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
|
||||
"dependencies": {
|
||||
"normalize-path": "^3.0.0",
|
||||
"picomatch": "^2.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/binary-extensions": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
|
||||
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/chokidar": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
||||
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://paulmillr.com/funding/"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"anymatch": "~3.1.2",
|
||||
"braces": "~3.0.2",
|
||||
"glob-parent": "~5.1.2",
|
||||
"is-binary-path": "~2.1.0",
|
||||
"is-glob": "~4.0.1",
|
||||
"normalize-path": "~3.0.0",
|
||||
"readdirp": "~3.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.10.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/cliui": {
|
||||
"version": "7.0.4",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
|
||||
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
|
||||
"dependencies": {
|
||||
"string-width": "^4.2.0",
|
||||
"strip-ansi": "^6.0.0",
|
||||
"wrap-ansi": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/diff": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
|
||||
"integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
|
||||
"engines": {
|
||||
"node": ">=0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/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==",
|
||||
"dependencies": {
|
||||
"is-glob": "^4.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/glob/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/glob/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/is-binary-path": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
|
||||
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
|
||||
"dependencies": {
|
||||
"binary-extensions": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/minimatch": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
|
||||
"integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/nanoid": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz",
|
||||
"integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==",
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/readdirp": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
|
||||
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
|
||||
"dependencies": {
|
||||
"picomatch": "^2.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/yargs": {
|
||||
"version": "16.2.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
|
||||
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
|
||||
"dependencies": {
|
||||
"cliui": "^7.0.2",
|
||||
"escalade": "^3.1.1",
|
||||
"get-caller-file": "^2.0.5",
|
||||
"require-directory": "^2.1.1",
|
||||
"string-width": "^4.2.0",
|
||||
"y18n": "^5.0.5",
|
||||
"yargs-parser": "^20.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/yargs-parser": {
|
||||
"version": "20.2.4",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
|
||||
"integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/mri": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
|
||||
@ -10436,7 +10263,6 @@
|
||||
"version": "1.29.0",
|
||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz",
|
||||
"integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
@ -10637,14 +10463,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/randombytes": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react": {
|
||||
"version": "18.2.0",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
|
||||
@ -10686,6 +10504,14 @@
|
||||
"react": "^16.8.0 || ^17 || ^18"
|
||||
}
|
||||
},
|
||||
"node_modules/react-intersection-observer": {
|
||||
"version": "9.5.2",
|
||||
"resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.5.2.tgz",
|
||||
"integrity": "sha512-EmoV66/yvksJcGa1rdW0nDNc4I1RifDWkT50gXSFnPLYQ4xUptuDD4V7k+Rj1OgVAlww628KLGcxPXFlOkkU/Q==",
|
||||
"peerDependencies": {
|
||||
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
@ -11476,6 +11302,7 @@
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
@ -11845,14 +11672,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/serialize-javascript": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz",
|
||||
"integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==",
|
||||
"dependencies": {
|
||||
"randombytes": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
@ -12606,6 +12425,7 @@
|
||||
"version": "8.1.1",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
|
||||
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
@ -13569,6 +13389,17 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/use-debounce": {
|
||||
"version": "9.0.4",
|
||||
"resolved": "https://registry.npmjs.org/use-debounce/-/use-debounce-9.0.4.tgz",
|
||||
"integrity": "sha512-6X8H/mikbrt0XE8e+JXRtZ8yYVvKkdYRfmIhWZYsP8rcNs9hk3APV8Ua2mFkKRLcJKVdnX2/Vwrmg2GWKUQEaQ==",
|
||||
"engines": {
|
||||
"node": ">= 10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/utf8-byte-length": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz",
|
||||
@ -13876,15 +13707,11 @@
|
||||
"string-width": "^1.0.2 || 2 || 3 || 4"
|
||||
}
|
||||
},
|
||||
"node_modules/workerpool": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
|
||||
"integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw=="
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.0.0",
|
||||
@ -13954,54 +13781,11 @@
|
||||
"node": ">=0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/xvfb-maybe": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/xvfb-maybe/-/xvfb-maybe-0.2.1.tgz",
|
||||
"integrity": "sha512-9IyRz3l6Qyhl6LvnGRF5jMPB4oBEepQnuzvVAFTynP6ACLLSevqigICJ9d/+ofl29m2daeaVBChnPYUnaeJ7yA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^2.2.0",
|
||||
"which": "^1.2.4"
|
||||
},
|
||||
"bin": {
|
||||
"xvfb-maybe": "src/xvfb-maybe.js"
|
||||
}
|
||||
},
|
||||
"node_modules/xvfb-maybe/node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/xvfb-maybe/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/xvfb-maybe/node_modules/which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"which": "bin/which"
|
||||
}
|
||||
},
|
||||
"node_modules/y18n": {
|
||||
"version": "5.0.8",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
||||
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
@ -14026,6 +13810,7 @@
|
||||
"version": "17.7.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
|
||||
"integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cliui": "^8.0.1",
|
||||
@ -14044,33 +13829,12 @@
|
||||
"version": "21.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
|
||||
"integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs-unparser": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz",
|
||||
"integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==",
|
||||
"dependencies": {
|
||||
"camelcase": "^6.0.0",
|
||||
"decamelize": "^4.0.0",
|
||||
"flat": "^5.0.2",
|
||||
"is-plain-obj": "^2.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs-unparser/node_modules/is-plain-obj": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
|
||||
"integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/yauzl": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
|
||||
@ -14113,12 +13877,41 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"plugin-core": {
|
||||
"name": "@janhq/plugin-core",
|
||||
"version": "0.1.5",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.2",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
},
|
||||
"plugin-core/node_modules/@types/node": {
|
||||
"version": "12.20.55",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz",
|
||||
"integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==",
|
||||
"dev": true
|
||||
},
|
||||
"plugin-core/node_modules/typescript": {
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
|
||||
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"name": "jan-web",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@headlessui/react": "^1.7.15",
|
||||
"@heroicons/react": "^2.0.18",
|
||||
"@janhq/plugin-core": "file:../plugin-core",
|
||||
"@tailwindcss/typography": "^0.5.9",
|
||||
"@types/react": "18.2.15",
|
||||
"@types/react-dom": "18.2.7",
|
||||
@ -14129,14 +13922,20 @@
|
||||
"embla-carousel-react": "^8.0.0-rc11",
|
||||
"eslint": "8.45.0",
|
||||
"eslint-config-next": "13.4.10",
|
||||
"framer-motion": "^10.16.4",
|
||||
"highlight.js": "^11.9.0",
|
||||
"jotai": "^2.4.0",
|
||||
"jotai-optics": "^0.3.1",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"lodash": "^4.17.21",
|
||||
"marked": "^9.1.2",
|
||||
"marked-highlight": "^2.0.6",
|
||||
"next": "13.4.10",
|
||||
"next-auth": "^4.23.1",
|
||||
"next-themes": "^0.2.1",
|
||||
"optics-ts": "^2.4.1",
|
||||
"postcss": "8.4.26",
|
||||
"prismjs": "^1.29.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
@ -14192,6 +13991,14 @@
|
||||
"postcss": "^8.1.0"
|
||||
}
|
||||
},
|
||||
"web/node_modules/highlight.js": {
|
||||
"version": "11.9.0",
|
||||
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.9.0.tgz",
|
||||
"integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"web/node_modules/postcss": {
|
||||
"version": "8.4.26",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.26.tgz",
|
||||
|
||||
23
package.json
@ -14,23 +14,24 @@
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "yarn workspace jan-electron lint && yarn workspace jan-web lint",
|
||||
"test": "yarn workspace jan-electron test:e2e",
|
||||
"dev:electron": "yarn workspace jan-electron dev",
|
||||
"lint": "yarn workspace jan lint && yarn workspace jan-web lint",
|
||||
"test": "yarn workspace jan test:e2e",
|
||||
"dev:electron": "yarn workspace jan dev",
|
||||
"dev:web": "yarn workspace jan-web dev",
|
||||
"dev": "concurrently --kill-others \"yarn dev:web\" \"wait-on http://localhost:3000 && yarn dev:electron\"",
|
||||
"build:core": "cd plugin-core && yarn install && yarn run build",
|
||||
"build:web": "yarn workspace jan-web build && cpx \"web/out/**\" \"electron/renderer/\"",
|
||||
"build:electron": "yarn workspace jan-electron build",
|
||||
"build:electron": "yarn workspace jan build",
|
||||
"build:plugins": "rimraf ./electron/core/pre-install/*.tgz && concurrently \"cd ./electron/core/plugins/data-plugin && npm ci\" \"cd ./electron/core/plugins/inference-plugin && npm ci\" \"cd ./electron/core/plugins/model-management-plugin && npm ci\" \"cd ./electron/core/plugins/monitoring-plugin && npm ci\" && concurrently \"cd ./electron/core/plugins/data-plugin && npm run build:publish\" \"cd ./electron/core/plugins/inference-plugin && npm run build:publish\" \"cd ./electron/core/plugins/model-management-plugin && npm run build:publish\" \"cd ./electron/core/plugins/monitoring-plugin && npm run build:publish\"",
|
||||
"build:plugins-darwin": "rimraf ./electron/core/pre-install/*.tgz && concurrently \"cd ./electron/core/plugins/data-plugin && npm ci\" \"cd ./electron/core/plugins/inference-plugin && npm ci\" \"cd ./electron/core/plugins/model-management-plugin && npm ci\" \"cd ./electron/core/plugins/monitoring-plugin && npm ci\" && chmod +x ./electron/auto-sign.sh && ./electron/auto-sign.sh && concurrently \"cd ./electron/core/plugins/data-plugin && npm run build:publish\" \"cd ./electron/core/plugins/inference-plugin && npm run build:publish\" \"cd ./electron/core/plugins/model-management-plugin && npm run build:publish\" \"cd ./electron/core/plugins/monitoring-plugin && npm run build:publish\"",
|
||||
"build": "yarn build:web && yarn build:electron",
|
||||
"build:darwin": "yarn build:web && yarn workspace jan-electron build:darwin",
|
||||
"build:win32": "yarn build:web && yarn workspace jan-electron build:win32",
|
||||
"build:linux": "yarn build:web && yarn workspace jan-electron build:linux",
|
||||
"build:publish": "yarn build:web && yarn workspace jan-electron build:publish",
|
||||
"build:publish-darwin": "yarn build:web && yarn workspace jan-electron build:publish-darwin",
|
||||
"build:publish-win32": "yarn build:web && yarn workspace jan-electron build:publish-win32",
|
||||
"build:publish-linux": "yarn build:web && yarn workspace jan-electron build:publish-linux"
|
||||
"build:darwin": "yarn build:web && yarn workspace jan build:darwin",
|
||||
"build:win32": "yarn build:web && yarn workspace jan build:win32",
|
||||
"build:linux": "yarn build:web && yarn workspace jan build:linux",
|
||||
"build:publish": "yarn build:web && yarn workspace jan build:publish",
|
||||
"build:publish-darwin": "yarn build:web && yarn workspace jan build:publish-darwin",
|
||||
"build:publish-win32": "yarn build:web && yarn workspace jan build:publish-win32",
|
||||
"build:publish-linux": "yarn build:web && yarn workspace jan build:publish-linux"
|
||||
},
|
||||
"devDependencies": {
|
||||
"concurrently": "^8.2.1",
|
||||
|
||||
261
plugin-core/README.md
Normal file
@ -0,0 +1,261 @@
|
||||
## @janhq/plugin-core
|
||||
|
||||
> The module includes functions for communicating with core APIs, registering plugin extensions, and exporting type definitions.
|
||||
|
||||
## Usage
|
||||
|
||||
### Import the package
|
||||
|
||||
```js
|
||||
// javascript
|
||||
const core = require("@janhq/plugin-core");
|
||||
|
||||
// typescript
|
||||
import { core } from "@janhq/plugin-core";
|
||||
```
|
||||
|
||||
### Register Plugin Extensions
|
||||
|
||||
Every plugin must define an `init` function in its main entry file to initialize the plugin and register its extensions with the Jan platform.
|
||||
|
||||
You can `register` any function as a plugin extension using `CoreServiceAPI` below. For example, the `DataService.GetConversations` entry name can be used to register a function that retrieves conversations.
|
||||
|
||||
Once the extension is registered, it can be used by other plugins or components in the Jan platform. For example, a UI component might use the DataService.GetConversations extension to retrieve a list of conversations to display to the user.
|
||||
|
||||
```js
|
||||
import { RegisterExtensionPoint, DataService } from "@janhq/plugin-core";
|
||||
|
||||
function getConversations() {
|
||||
// Your logic here
|
||||
}
|
||||
|
||||
export function init({ register }: { register: RegisterExtensionPoint }) {
|
||||
register(DataService.GetConversations, getConversations.name, getConversations);
|
||||
}
|
||||
```
|
||||
|
||||
### Access Core API
|
||||
|
||||
To access the Core API in your plugin, you can follow the code examples and explanations provided below.
|
||||
|
||||
##### Import Core API and Store Module
|
||||
|
||||
In your main entry code (e.g., `index.ts`), start by importing the necessary modules and functions from the `@janhq/plugin-core` library.
|
||||
|
||||
```js
|
||||
// index.ts
|
||||
import { store, core } from "@janhq/plugin-core";
|
||||
```
|
||||
|
||||
#### Interact with Local Data Storage
|
||||
|
||||
The Core API allows you to interact with local data storage. Here are a couple of examples of how you can use it:
|
||||
|
||||
#### Insert Data
|
||||
|
||||
You can use the store.insertOne function to insert data into a specific collection in the local data store.
|
||||
|
||||
```js
|
||||
function insertData() {
|
||||
store.insertOne("conversations", { name: "meow" });
|
||||
// Insert a new document with { name: "meow" } into the "conversations" collection.
|
||||
}
|
||||
```
|
||||
|
||||
#### Get Data
|
||||
|
||||
To retrieve data from a collection in the local data store, you can use the `store.findOne` or `store.findMany` function. It allows you to filter and retrieve documents based on specific criteria.
|
||||
|
||||
store.getOne(collectionName, key) retrieves a single document that matches the provided key in the specified collection.
|
||||
store.getMany(collectionName, selector, sort) retrieves multiple documents that match the provided selector in the specified collection.
|
||||
|
||||
```js
|
||||
function getData() {
|
||||
const selector = { name: "meow" };
|
||||
const data = store.findMany("conversations", selector);
|
||||
// Retrieve documents from the "conversations" collection that match the filter.
|
||||
}
|
||||
```
|
||||
|
||||
#### Update Data
|
||||
|
||||
You can update data in the local store using these functions:
|
||||
|
||||
store.updateOne(collectionName, key, update) updates a single document that matches the provided key in the specified collection.
|
||||
store.updateMany(collectionName, selector, update) updates multiple documents that match the provided selector in the specified collection.
|
||||
|
||||
```js
|
||||
function updateData() {
|
||||
const selector = { name: "meow" };
|
||||
const update = { name: "newName" };
|
||||
store.updateOne("conversations", selector, update);
|
||||
// Update a document in the "conversations" collection.
|
||||
}
|
||||
```
|
||||
|
||||
#### Delete Data
|
||||
|
||||
You can delete data from the local data store using these functions:
|
||||
|
||||
store.deleteOne(collectionName, key) deletes a single document that matches the provided key in the specified collection.
|
||||
store.deleteMany(collectionName, selector) deletes multiple documents that match the provided selector in the specified collection.
|
||||
|
||||
```js
|
||||
function deleteData() {
|
||||
const selector = { name: "meow" };
|
||||
store.deleteOne("conversations", selector);
|
||||
// Delete a document from the "conversations" collection.
|
||||
}
|
||||
```
|
||||
|
||||
#### Perform File Operations
|
||||
|
||||
The Core API also provides functions to perform file operations. Here are a couple of examples:
|
||||
|
||||
#### Download a File
|
||||
|
||||
You can download a file from a specified URL and save it with a given file name using the core.downloadFile function.
|
||||
|
||||
```js
|
||||
function downloadModel(url: string, fileName: string) {
|
||||
core.downloadFile(url, fileName);
|
||||
}
|
||||
```
|
||||
|
||||
#### Delete a File
|
||||
|
||||
To delete a file, you can use the core.deleteFile function, providing the path to the file you want to delete.
|
||||
|
||||
```js
|
||||
function deleteModel(filePath: string) {
|
||||
core.deleteFile(path);
|
||||
}
|
||||
```
|
||||
|
||||
### Execute plugin module in main process
|
||||
|
||||
To execute a plugin module in the main process of your application, you can follow the steps outlined below.
|
||||
|
||||
##### Import the `core` Object
|
||||
|
||||
In your main process code (e.g., `index.ts`), start by importing the `core` object from the `@janhq/plugin-core` library.
|
||||
|
||||
```js
|
||||
// index.ts
|
||||
import { core } from "@janhq/plugin-core";
|
||||
```
|
||||
|
||||
##### Define the Module Path
|
||||
|
||||
Specify the path to the plugin module you want to execute. This path should lead to the module file (e.g., module.js) that contains the functions you wish to call.
|
||||
|
||||
```js
|
||||
// index.ts
|
||||
const MODULE_PATH = "data-plugin/dist/module.js";
|
||||
```
|
||||
|
||||
##### Define the Function to Execute
|
||||
|
||||
Create a function that will execute a function defined in your plugin module. In the example provided, the function `getConversationMessages` is created to invoke the `getConvMessages` function from the plugin module.
|
||||
|
||||
```js
|
||||
// index.ts
|
||||
function getConversationMessages(id: number) {
|
||||
return core.invokePluginFunc(MODULE_PATH, "getConvMessages", id);
|
||||
}
|
||||
|
||||
export function init({ register }: { register: RegisterExtensionPoint }) {
|
||||
register(DataService.GetConversationMessages, getConversationMessages.name, getConversationMessages);
|
||||
}
|
||||
```
|
||||
|
||||
##### Define Your Plugin Module
|
||||
|
||||
In your plugin module (e.g., module.ts), define the logic for the function you wish to execute. In the example, the function getConvMessages is defined with a placeholder comment indicating where your logic should be implemented.
|
||||
|
||||
```js
|
||||
// module.ts
|
||||
function getConvMessages(id: number) {
|
||||
// Your logic here
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getConvMessages
|
||||
}
|
||||
```
|
||||
|
||||
## CoreService API
|
||||
|
||||
The `CoreService` type is an exported union type that includes:
|
||||
|
||||
- `StoreService`
|
||||
- `DataService`
|
||||
- `InferenceService`
|
||||
- `ModelManagementService`
|
||||
- `SystemMonitoringService`
|
||||
- `PreferenceService`
|
||||
|
||||
## StoreService
|
||||
|
||||
The `StoreService` enum represents available methods for managing the database store. It includes the following methods:
|
||||
|
||||
- `CreateCollection`: Creates a new collection in the data store.
|
||||
- `DeleteCollection`: Deletes an existing collection from the data store.
|
||||
- `InsertOne`: Inserts a new value into an existing collection in the data store.
|
||||
- `UpdateOne`: Updates an existing value in an existing collection in the data store.
|
||||
- `UpdateMany`: Updates multiple records in a collection in the data store.
|
||||
- `DeleteOne`: Deletes an existing value from an existing collection in the data store.
|
||||
- `DeleteMany`: Deletes multiple records in a collection in the data store.
|
||||
- `FindMany`: Retrieves multiple records from a collection in the data store.
|
||||
- `FindOne`: Retrieves a single record from a collection in the data store.
|
||||
|
||||
## DataService
|
||||
|
||||
The `DataService` enum represents methods related to managing conversations and messages. It includes the following methods:
|
||||
|
||||
- `GetConversations`: Gets a list of conversations from the data store.
|
||||
- `CreateConversation`: Creates a new conversation in the data store.
|
||||
- `DeleteConversation`: Deletes an existing conversation from the data store.
|
||||
- `CreateMessage`: Creates a new message in an existing conversation in the data store.
|
||||
- `UpdateMessage`: Updates an existing message in an existing conversation in the data store.
|
||||
- `GetConversationMessages`: Gets a list of messages for an existing conversation from the data store.
|
||||
|
||||
## InferenceService
|
||||
|
||||
The `InferenceService` enum exports:
|
||||
|
||||
- `InferenceUrl`: The URL for the inference server.
|
||||
- `InitModel`: Initializes a model for inference.
|
||||
- `StopModel`: Stops a running inference model.
|
||||
|
||||
## ModelManagementService
|
||||
|
||||
The `ModelManagementService` enum provides methods for managing models:
|
||||
|
||||
- `GetDownloadedModels`: Gets a list of downloaded models.
|
||||
- `GetAvailableModels`: Gets a list of available models from data store.
|
||||
- `DeleteModel`: Deletes a downloaded model.
|
||||
- `DownloadModel`: Downloads a model from the server.
|
||||
- `SearchModels`: Searches for models on the server.
|
||||
- `GetConfiguredModels`: Gets configured models from the data store.
|
||||
- `StoreModel`: Stores a model in the data store.
|
||||
- `UpdateFinishedDownloadAt`: Updates the finished download time for a model in the data store.
|
||||
- `GetUnfinishedDownloadModels`: Gets a list of unfinished download models from the data store.
|
||||
- `GetFinishedDownloadModels`: Gets a list of finished download models from the data store.
|
||||
- `DeleteDownloadModel`: Deletes a downloaded model from the data store.
|
||||
- `GetModelById`: Gets a model by its ID from the data store.
|
||||
|
||||
## PreferenceService
|
||||
|
||||
The `PreferenceService` enum provides methods for managing plugin preferences:
|
||||
|
||||
- `ExperimentComponent`: Represents the UI experiment component for a testing function.
|
||||
|
||||
## SystemMonitoringService
|
||||
|
||||
The `SystemMonitoringService` enum includes methods for monitoring system resources:
|
||||
|
||||
- `GetResourcesInfo`: Gets information about system resources.
|
||||
- `GetCurrentLoad`: Gets the current system load.
|
||||
|
||||
For more detailed information on each of these components, please refer to the source code.
|
||||
51
plugin-core/core.ts
Normal file
@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Execute a plugin module function in main process
|
||||
*
|
||||
* @param plugin plugin name to import
|
||||
* @param method function name to execute
|
||||
* @param args arguments to pass to the function
|
||||
* @returns Promise<any>
|
||||
*
|
||||
*/
|
||||
const invokePluginFunc: (
|
||||
plugin: string,
|
||||
method: string,
|
||||
...args: any[]
|
||||
) => Promise<any> = (plugin, method, ...args) =>
|
||||
window.coreAPI?.invokePluginFunc(plugin, method, ...args) ??
|
||||
window.electronAPI?.invokePluginFunc(plugin, method, ...args);
|
||||
|
||||
/**
|
||||
* Downloads a file from a URL and saves it to the local file system.
|
||||
* @param {string} url - The URL of the file to download.
|
||||
* @param {string} fileName - The name to use for the downloaded file.
|
||||
* @returns {Promise<any>} A promise that resolves when the file is downloaded.
|
||||
*/
|
||||
const downloadFile: (url: string, fileName: string) => Promise<any> = (url, fileName) =>
|
||||
window.coreAPI?.downloadFile(url, fileName) ?? window.electronAPI?.downloadFile(url, fileName);
|
||||
|
||||
/**
|
||||
* Deletes a file from the local file system.
|
||||
* @param {string} path - The path of the file to delete.
|
||||
* @returns {Promise<any>} A promise that resolves when the file is deleted.
|
||||
*/
|
||||
const deleteFile: (path: string) => Promise<any> = (path) =>
|
||||
window.coreAPI?.deleteFile(path) ?? window.electronAPI?.deleteFile(path);
|
||||
|
||||
/** Register extension point function type definition
|
||||
*
|
||||
*/
|
||||
export type RegisterExtensionPoint = (
|
||||
extensionName: string,
|
||||
extensionId: string,
|
||||
method: Function,
|
||||
priority?: number
|
||||
) => void;
|
||||
/**
|
||||
* Core exports
|
||||
*/
|
||||
export const core = {
|
||||
invokePluginFunc,
|
||||
downloadFile,
|
||||
deleteFile,
|
||||
};
|
||||
229
plugin-core/index.ts
Normal file
@ -0,0 +1,229 @@
|
||||
/**
|
||||
* CoreService exports
|
||||
*/
|
||||
|
||||
export type CoreService =
|
||||
| StoreService
|
||||
| DataService
|
||||
| InferenceService
|
||||
| ModelManagementService
|
||||
| SystemMonitoringService
|
||||
| PreferenceService;
|
||||
|
||||
/**
|
||||
* Represents the available methods for the StoreService.
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum StoreService {
|
||||
/**
|
||||
* Creates a new collection in the database store.
|
||||
*/
|
||||
CreateCollection = "createCollection",
|
||||
|
||||
/**
|
||||
* Deletes an existing collection from the database store.
|
||||
*/
|
||||
DeleteCollection = "deleteCollection",
|
||||
|
||||
/**
|
||||
* Inserts a new value into an existing collection in the database store.
|
||||
*/
|
||||
InsertOne = "insertOne",
|
||||
|
||||
/**
|
||||
* Updates an existing value in an existing collection in the database store.
|
||||
*/
|
||||
UpdateOne = "updateOne",
|
||||
|
||||
/**
|
||||
* Updates multiple records in a collection in the database store.
|
||||
*/
|
||||
UpdateMany = "updateMany",
|
||||
|
||||
/**
|
||||
* Deletes an existing value from an existing collection in the database store.
|
||||
*/
|
||||
DeleteOne = "deleteOne",
|
||||
|
||||
/**
|
||||
* Delete multiple records in a collection in the database store.
|
||||
*/
|
||||
DeleteMany = "deleteMany",
|
||||
|
||||
/**
|
||||
* Retrieve multiple records from a collection in the data store
|
||||
*/
|
||||
FindMany = "findMany",
|
||||
|
||||
/**
|
||||
* Retrieve a record from a collection in the data store.
|
||||
*/
|
||||
FindOne = "findOne",
|
||||
}
|
||||
|
||||
/**
|
||||
* DataService exports.
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum DataService {
|
||||
/**
|
||||
* Gets a list of conversations from the server.
|
||||
*/
|
||||
GetConversations = "getConversations",
|
||||
|
||||
/**
|
||||
* Creates a new conversation on the server.
|
||||
*/
|
||||
CreateConversation = "createConversation",
|
||||
|
||||
/**
|
||||
* Updates an existing conversation on the server.
|
||||
*/
|
||||
UpdateConversation = "updateConversation",
|
||||
|
||||
/**
|
||||
* Deletes an existing conversation from the server.
|
||||
*/
|
||||
DeleteConversation = "deleteConversation",
|
||||
|
||||
/**
|
||||
* Creates a new message in an existing conversation on the server.
|
||||
*/
|
||||
CreateMessage = "createMessage",
|
||||
|
||||
/**
|
||||
* Updates an existing message in an existing conversation on the server.
|
||||
*/
|
||||
UpdateMessage = "updateMessage",
|
||||
|
||||
/**
|
||||
* Gets a list of messages for an existing conversation from the server.
|
||||
*/
|
||||
GetConversationMessages = "getConversationMessages",
|
||||
}
|
||||
|
||||
/**
|
||||
* InferenceService exports.
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum InferenceService {
|
||||
/**
|
||||
* The URL for the inference server.
|
||||
*/
|
||||
InferenceUrl = "inferenceUrl",
|
||||
|
||||
/**
|
||||
* Initializes a model for inference.
|
||||
*/
|
||||
InitModel = "initModel",
|
||||
|
||||
/**
|
||||
* Stops a running inference model.
|
||||
*/
|
||||
StopModel = "stopModel",
|
||||
}
|
||||
|
||||
/**
|
||||
* ModelManagementService exports.
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum ModelManagementService {
|
||||
/**
|
||||
* Gets a list of downloaded models.
|
||||
*/
|
||||
GetDownloadedModels = "getDownloadedModels",
|
||||
|
||||
/**
|
||||
* Gets a list of available models from the server.
|
||||
*/
|
||||
GetAvailableModels = "getAvailableModels",
|
||||
|
||||
/**
|
||||
* Deletes a downloaded model.
|
||||
*/
|
||||
DeleteModel = "deleteModel",
|
||||
|
||||
/**
|
||||
* Downloads a model from the server.
|
||||
*/
|
||||
DownloadModel = "downloadModel",
|
||||
|
||||
/**
|
||||
* Searches for models on the server.
|
||||
*/
|
||||
SearchModels = "searchModels",
|
||||
|
||||
/**
|
||||
* Gets configued models from the database.
|
||||
*/
|
||||
GetConfiguredModels = "getConfiguredModels",
|
||||
|
||||
/**
|
||||
* Stores a model in the database.
|
||||
*/
|
||||
StoreModel = "storeModel",
|
||||
|
||||
/**
|
||||
* Updates the finished download time for a model in the database.
|
||||
*/
|
||||
UpdateFinishedDownloadAt = "updateFinishedDownloadAt",
|
||||
|
||||
/**
|
||||
* Gets a list of unfinished download models from the database.
|
||||
*/
|
||||
GetUnfinishedDownloadModels = "getUnfinishedDownloadModels",
|
||||
|
||||
/**
|
||||
* Gets a list of finished download models from the database.
|
||||
*/
|
||||
GetFinishedDownloadModels = "getFinishedDownloadModels",
|
||||
|
||||
/**
|
||||
* Deletes a download model from the database.
|
||||
*/
|
||||
DeleteDownloadModel = "deleteDownloadModel",
|
||||
|
||||
/**
|
||||
* Gets a model by its ID from the database.
|
||||
*/
|
||||
GetModelById = "getModelById",
|
||||
}
|
||||
|
||||
/**
|
||||
* PreferenceService exports.
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PreferenceService {
|
||||
/**
|
||||
* The experiment component for which preferences are being managed.
|
||||
*/
|
||||
ExperimentComponent = "experimentComponent",
|
||||
}
|
||||
|
||||
/**
|
||||
* SystemMonitoringService exports.
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum SystemMonitoringService {
|
||||
/**
|
||||
* Gets information about system resources.
|
||||
*/
|
||||
GetResourcesInfo = "getResourcesInfo",
|
||||
|
||||
/**
|
||||
* Gets the current system load.
|
||||
*/
|
||||
GetCurrentLoad = "getCurrentLoad",
|
||||
}
|
||||
|
||||
/**
|
||||
* Store module exports.
|
||||
* @module
|
||||
*/
|
||||
export { store } from "./store";
|
||||
|
||||
/**
|
||||
* Core module exports.
|
||||
* @module
|
||||
*/
|
||||
export { core, RegisterExtensionPoint } from "./core";
|
||||
22
plugin-core/package-lock.json
generated
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "@janhq/plugin-core",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@janhq/plugin-core",
|
||||
"version": "0.1.0",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "12.20.55",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz",
|
||||
"integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
37
plugin-core/package.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@janhq/plugin-core",
|
||||
"version": "0.1.6",
|
||||
"description": "Plugin core lib",
|
||||
"keywords": [
|
||||
"jan",
|
||||
"plugin",
|
||||
"core"
|
||||
],
|
||||
"homepage": "https://github.com/janhq",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "__tests__"
|
||||
},
|
||||
"exports": {
|
||||
".": "./lib/index.js",
|
||||
"./store": "./lib/store.js"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"README.md",
|
||||
"LICENSE.md",
|
||||
"package.json",
|
||||
"!.DS_Store"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||
"build": "tsc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.2",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
129
plugin-core/store.ts
Normal file
@ -0,0 +1,129 @@
|
||||
/**
|
||||
* Creates, reads, updates, and deletes data in a data store.
|
||||
* @module
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a new collection in the data store.
|
||||
* @param {string} name - The name of the collection to create.
|
||||
* @param { [key: string]: any } schema - schema of the collection to create, include fields and their types
|
||||
* @returns {Promise<void>} A promise that resolves when the collection is created.
|
||||
*/
|
||||
function createCollection(
|
||||
name: string,
|
||||
schema: { [key: string]: any }
|
||||
): Promise<void> {
|
||||
return window.corePlugin?.store?.createCollection(name, schema);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a collection from the data store.
|
||||
* @param {string} name - The name of the collection to delete.
|
||||
* @returns {Promise<void>} A promise that resolves when the collection is deleted.
|
||||
*/
|
||||
function deleteCollection(name: string): Promise<void> {
|
||||
return window.corePlugin?.store?.deleteCollection(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts a value into a collection in the data store.
|
||||
* @param {string} collectionName - The name of the collection to insert the value into.
|
||||
* @param {any} value - The value to insert into the collection.
|
||||
* @returns {Promise<any>} A promise that resolves with the inserted value.
|
||||
*/
|
||||
function insertOne(collectionName: string, value: any): Promise<any> {
|
||||
return window.corePlugin?.store?.insertOne(collectionName, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a record from a collection in the data store.
|
||||
* @param {string} collectionName - The name of the collection containing the record to retrieve.
|
||||
* @param {string} key - The key of the record to retrieve.
|
||||
* @returns {Promise<any>} A promise that resolves when the record is retrieved.
|
||||
*/
|
||||
function findOne(collectionName: string, key: string): Promise<any> {
|
||||
return window.corePlugin?.store?.findOne(collectionName, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all records that match a selector in a collection in the data store.
|
||||
* @param {string} collectionName - The name of the collection to retrieve.
|
||||
* @param {{ [key: string]: any }} selector - The selector to use to get records from the collection.
|
||||
* @param {[{ [key: string]: any }]} sort - The sort options to use to retrieve records.
|
||||
* @returns {Promise<any>} A promise that resolves when all records are retrieved.
|
||||
*/
|
||||
function findMany(
|
||||
collectionName: string,
|
||||
selector?: { [key: string]: any },
|
||||
sort?: [{ [key: string]: any }]
|
||||
): Promise<any> {
|
||||
return window.corePlugin?.store?.findMany(collectionName, selector, sort);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the value of a record in a collection in the data store.
|
||||
* @param {string} collectionName - The name of the collection containing the record to update.
|
||||
* @param {string} key - The key of the record to update.
|
||||
* @param {any} value - The new value for the record.
|
||||
* @returns {Promise<void>} A promise that resolves when the record is updated.
|
||||
*/
|
||||
function updateOne(
|
||||
collectionName: string,
|
||||
key: string,
|
||||
value: any
|
||||
): Promise<void> {
|
||||
return window.corePlugin?.store?.updateOne(collectionName, key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates all records that match a selector in a collection in the data store.
|
||||
* @param {string} collectionName - The name of the collection containing the records to update.
|
||||
* @param {{ [key: string]: any }} selector - The selector to use to get the records to update.
|
||||
* @param {any} value - The new value for the records.
|
||||
* @returns {Promise<void>} A promise that resolves when the records are updated.
|
||||
*/
|
||||
function updateMany(
|
||||
collectionName: string,
|
||||
value: any,
|
||||
selector?: { [key: string]: any }
|
||||
): Promise<void> {
|
||||
return window.corePlugin?.store?.updateMany(collectionName, selector, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a single record from a collection in the data store.
|
||||
* @param {string} collectionName - The name of the collection containing the record to delete.
|
||||
* @param {string} key - The key of the record to delete.
|
||||
* @returns {Promise<void>} A promise that resolves when the record is deleted.
|
||||
*/
|
||||
function deleteOne(collectionName: string, key: string): Promise<void> {
|
||||
return window.corePlugin?.store?.deleteOne(collectionName, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all records with a matching key from a collection in the data store.
|
||||
* @param {string} collectionName - The name of the collection to delete the records from.
|
||||
* @param {{ [key: string]: any }} selector - The selector to use to get the records to delete.
|
||||
* @returns {Promise<void>} A promise that resolves when the records are deleted.
|
||||
*/
|
||||
function deleteMany(
|
||||
collectionName: string,
|
||||
selector?: { [key: string]: any }
|
||||
): Promise<void> {
|
||||
return window.corePlugin?.store?.deleteMany(collectionName, selector);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports the data store operations as an object.
|
||||
*/
|
||||
export const store = {
|
||||
createCollection,
|
||||
deleteCollection,
|
||||
insertOne,
|
||||
findOne,
|
||||
findMany,
|
||||
updateOne,
|
||||
updateMany,
|
||||
deleteOne,
|
||||
deleteMany,
|
||||
};
|
||||
13
plugin-core/tsconfig.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2016",
|
||||
"module": "ES6",
|
||||
"outDir": "./lib",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"declaration": true
|
||||
},
|
||||
"exclude": ["lib", "node_modules", "**/*.test.ts", "**/__mocks__/*"]
|
||||
}
|
||||
12
plugin-core/types/index.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
export {};
|
||||
|
||||
declare global {
|
||||
interface CorePlugin {
|
||||
store?: any | undefined;
|
||||
}
|
||||
interface Window {
|
||||
corePlugin?: CorePlugin;
|
||||
coreAPI?: any | undefined;
|
||||
electronAPI?: any | undefined;
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
import { useAtomValue } from "jotai";
|
||||
import React, { Fragment } from "react";
|
||||
import React from "react";
|
||||
import ModelTable from "../ModelTable";
|
||||
import { currentProductAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import { activeAssistantModelAtom } from "@/_helpers/atoms/Model.atom";
|
||||
|
||||
const ActiveModelTable: React.FC = () => {
|
||||
const activeModel = useAtomValue(currentProductAtom);
|
||||
const activeModel = useAtomValue(activeAssistantModelAtom);
|
||||
|
||||
if (!activeModel) return null;
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
import { Product } from "@/_models/Product";
|
||||
import DownloadModelContent from "../DownloadModelContent";
|
||||
import ModelDownloadButton from "../ModelDownloadButton";
|
||||
import ModelDownloadingButton from "../ModelDownloadingButton";
|
||||
import { useAtomValue } from "jotai";
|
||||
import { modelDownloadStateAtom } from "@/_helpers/atoms/DownloadState.atom";
|
||||
import { AssistantModel } from "@/_models/AssistantModel";
|
||||
|
||||
type Props = {
|
||||
product: Product;
|
||||
model: AssistantModel;
|
||||
isRecommend: boolean;
|
||||
required?: string;
|
||||
onDownloadClick?: (product: Product) => void;
|
||||
onDownloadClick?: (model: AssistantModel) => void;
|
||||
};
|
||||
|
||||
const AvailableModelCard: React.FC<Props> = ({
|
||||
product,
|
||||
model,
|
||||
isRecommend,
|
||||
required,
|
||||
onDownloadClick,
|
||||
@ -24,14 +24,14 @@ const AvailableModelCard: React.FC<Props> = ({
|
||||
let total = 0;
|
||||
let transferred = 0;
|
||||
|
||||
if (product.fileName && downloadState[product.fileName]) {
|
||||
if (model._id && downloadState[model._id]) {
|
||||
isDownloading =
|
||||
downloadState[product.fileName].error == null &&
|
||||
downloadState[product.fileName].percent < 1;
|
||||
downloadState[model._id].error == null &&
|
||||
downloadState[model._id].percent < 1;
|
||||
|
||||
if (isDownloading) {
|
||||
total = downloadState[product.fileName].size.total;
|
||||
transferred = downloadState[product.fileName].size.transferred;
|
||||
total = downloadState[model._id].size.total;
|
||||
transferred = downloadState[model._id].size.transferred;
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ const AvailableModelCard: React.FC<Props> = ({
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-1/5 flex items-center justify-end">
|
||||
<ModelDownloadButton callback={() => onDownloadClick?.(product)} />
|
||||
<ModelDownloadButton callback={() => onDownloadClick?.(model)} />
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -50,11 +50,11 @@ const AvailableModelCard: React.FC<Props> = ({
|
||||
<div className="flex justify-between py-4 px-3 gap-2.5">
|
||||
<DownloadModelContent
|
||||
required={required}
|
||||
author={product.author}
|
||||
description={product.description}
|
||||
author={model.author}
|
||||
description={model.shortDescription}
|
||||
isRecommend={isRecommend}
|
||||
name={product.name}
|
||||
type={product.type}
|
||||
name={model.name}
|
||||
type={model.type}
|
||||
/>
|
||||
{downloadButton}
|
||||
</div>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useSetAtom } from "jotai";
|
||||
import SecondaryButton from "../SecondaryButton";
|
||||
import { InformationCircleIcon } from "@heroicons/react/24/outline";
|
||||
import SendButton from "../SendButton";
|
||||
import { showingAdvancedPromptAtom } from "@/_helpers/atoms/Modal.atom";
|
||||
|
||||
@ -11,22 +11,21 @@ const BasicPromptAccessories: React.FC = () => {
|
||||
const shouldShowAdvancedPrompt = false;
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: "#F8F8F8",
|
||||
borderWidth: 1,
|
||||
borderColor: "#D1D5DB",
|
||||
}}
|
||||
className="flex justify-between py-2 pl-3 pr-2 rounded-b-lg"
|
||||
>
|
||||
{shouldShowAdvancedPrompt && (
|
||||
<SecondaryButton
|
||||
title="Advanced"
|
||||
onClick={() => setShowingAdvancedPrompt(true)}
|
||||
/>
|
||||
)}
|
||||
<div className="flex justify-end items-center space-x-1 w-full pr-3" />
|
||||
{!shouldShowAdvancedPrompt && <SendButton />}
|
||||
<div className="absolute inset-x-0 bottom-0 flex justify-between py-2 pl-3 pr-2">
|
||||
{/* Add future accessories here, e.g upload a file */}
|
||||
<div className="flex items-center space-x-5">
|
||||
<div className="flex items-center">
|
||||
{/* <button
|
||||
type="button"
|
||||
className="-m-2.5 flex h-10 w-10 items-center justify-center rounded-full text-gray-400 hover:text-gray-500"
|
||||
>
|
||||
<InformationCircleIcon className="h-5 w-5" aria-hidden="true" />
|
||||
</button> */}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-shrink-0">
|
||||
<SendButton />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@ -7,7 +7,7 @@ import useCreateConversation from "@/_hooks/useCreateConversation";
|
||||
import useInitModel from "@/_hooks/useInitModel";
|
||||
import useSendChatMessage from "@/_hooks/useSendChatMessage";
|
||||
import { useAtom, useAtomValue } from "jotai";
|
||||
import { ChangeEvent } from "react";
|
||||
import { ChangeEvent, useEffect, useRef } from "react";
|
||||
|
||||
const BasicPromptInput: React.FC = () => {
|
||||
const activeConversationId = useAtomValue(getActiveConvoIdAtom);
|
||||
@ -18,9 +18,7 @@ const BasicPromptInput: React.FC = () => {
|
||||
|
||||
const { initModel } = useInitModel();
|
||||
|
||||
const handleMessageChange = (event: ChangeEvent<HTMLTextAreaElement>) => {
|
||||
setCurrentPrompt(event.target.value);
|
||||
};
|
||||
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
||||
const handleKeyDown = async (
|
||||
event: React.KeyboardEvent<HTMLTextAreaElement>
|
||||
@ -44,17 +42,53 @@ const BasicPromptInput: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
adjustTextareaHeight();
|
||||
}, [currentPrompt]);
|
||||
|
||||
const handleMessageChange = (event: ChangeEvent<HTMLTextAreaElement>) => {
|
||||
setCurrentPrompt(event.target.value);
|
||||
};
|
||||
|
||||
// Auto adjust textarea height based on content
|
||||
const MAX_ROWS = 30;
|
||||
|
||||
const adjustTextareaHeight = () => {
|
||||
if (textareaRef.current) {
|
||||
textareaRef.current.style.height = "auto"; // 1 row
|
||||
const scrollHeight = textareaRef.current.scrollHeight;
|
||||
const maxScrollHeight =
|
||||
parseInt(window.getComputedStyle(textareaRef.current).lineHeight, 10) *
|
||||
MAX_ROWS;
|
||||
textareaRef.current.style.height = `${Math.min(
|
||||
scrollHeight,
|
||||
maxScrollHeight
|
||||
)}px`;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<textarea
|
||||
onKeyDown={handleKeyDown}
|
||||
value={currentPrompt}
|
||||
onChange={handleMessageChange}
|
||||
rows={2}
|
||||
name="comment"
|
||||
id="comment"
|
||||
className="overflow-hidden block w-full scroll resize-none border-0 bg-transparent py-1.5 text-gray-900 transition-height duration-200 placeholder:text-gray-400 sm:text-sm sm:leading-6 dark:text-white"
|
||||
placeholder="Add your comment..."
|
||||
/>
|
||||
<div className="overflow-hidden rounded-lg shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-indigo-600">
|
||||
<textarea
|
||||
ref={textareaRef}
|
||||
onKeyDown={handleKeyDown}
|
||||
value={currentPrompt}
|
||||
onChange={handleMessageChange}
|
||||
name="comment"
|
||||
id="comment"
|
||||
className="block w-full resize-none border-0 bg-transparent py-1.5 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm sm:leading-6"
|
||||
placeholder="Message ..."
|
||||
rows={1}
|
||||
style={{ overflow: "auto" }}
|
||||
/>
|
||||
{/* Spacer element to match the height of the toolbar */}
|
||||
<div className="py-2" aria-hidden="true">
|
||||
{/* Matches height of button in toolbar (1px border + 36px content height) */}
|
||||
<div className="py-px">
|
||||
<div className="h-9" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
import React from "react";
|
||||
import Image from "next/image";
|
||||
import useCreateConversation from "@/_hooks/useCreateConversation";
|
||||
import { Product } from "@/_models/Product";
|
||||
import { AssistantModel } from "@/_models/AssistantModel";
|
||||
|
||||
type Props = {
|
||||
product: Product;
|
||||
model: AssistantModel;
|
||||
};
|
||||
|
||||
const ConversationalCard: React.FC<Props> = ({ product }) => {
|
||||
const ConversationalCard: React.FC<Props> = ({ model }) => {
|
||||
const { requestCreateConvo } = useCreateConversation();
|
||||
|
||||
const { name, avatarUrl, description } = product;
|
||||
const { name, avatarUrl, shortDescription } = model;
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={() => requestCreateConvo(product)}
|
||||
onClick={() => requestCreateConvo(model)}
|
||||
className="flex flex-col justify-between flex-shrink-0 gap-3 bg-white p-4 w-52 rounded-lg text-left dark:bg-gray-700 hover:opacity-20"
|
||||
>
|
||||
<div className="flex flex-col gap-2 box-border">
|
||||
@ -29,7 +29,7 @@ const ConversationalCard: React.FC<Props> = ({ product }) => {
|
||||
{name}
|
||||
</h2>
|
||||
<span className="text-gray-600 mt-1 font-normal line-clamp-2">
|
||||
{description}
|
||||
{shortDescription}
|
||||
</span>
|
||||
</div>
|
||||
<span className="flex text-xs leading-5 text-gray-500 items-center gap-0.5">
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { Product } from "@/_models/Product";
|
||||
import { AssistantModel } from "@/_models/AssistantModel";
|
||||
import ConversationalCard from "../ConversationalCard";
|
||||
import { ChatBubbleBottomCenterTextIcon } from "@heroicons/react/24/outline";
|
||||
|
||||
type Props = {
|
||||
products: Product[];
|
||||
models: AssistantModel[];
|
||||
};
|
||||
|
||||
const ConversationalList: React.FC<Props> = ({ products }) => (
|
||||
const ConversationalList: React.FC<Props> = ({ models }) => (
|
||||
<>
|
||||
<div className="flex items-center gap-3 mt-8 mb-2">
|
||||
<ChatBubbleBottomCenterTextIcon width={24} height={24} className="ml-6" />
|
||||
@ -15,8 +15,8 @@ const ConversationalList: React.FC<Props> = ({ products }) => (
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-2 pl-6 flex w-full gap-2 overflow-x-scroll scroll overflow-hidden">
|
||||
{products.map((item) => (
|
||||
<ConversationalCard key={item.slug} product={item} />
|
||||
{models.map((item) => (
|
||||
<ConversationalCard key={item._id} model={item} />
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
import { Product } from "@/_models/Product";
|
||||
import { AssistantModel } from "@/_models/AssistantModel";
|
||||
import DownloadModelContent from "../DownloadModelContent";
|
||||
|
||||
type Props = {
|
||||
product: Product;
|
||||
model: AssistantModel;
|
||||
isRecommend: boolean;
|
||||
required?: string;
|
||||
transferred?: number;
|
||||
onDeleteClick?: (product: Product) => void;
|
||||
onDeleteClick?: (model: AssistantModel) => void;
|
||||
};
|
||||
|
||||
const DownloadedModelCard: React.FC<Props> = ({
|
||||
product,
|
||||
model,
|
||||
isRecommend,
|
||||
required,
|
||||
onDeleteClick,
|
||||
@ -19,14 +19,14 @@ const DownloadedModelCard: React.FC<Props> = ({
|
||||
<div className="flex justify-between py-4 px-3 gap-2.5">
|
||||
<DownloadModelContent
|
||||
required={required}
|
||||
author={product.author}
|
||||
description={product.description}
|
||||
author={model.author}
|
||||
description={model.shortDescription}
|
||||
isRecommend={isRecommend}
|
||||
name={product.name}
|
||||
type={product.type}
|
||||
name={model.name}
|
||||
type={model.type}
|
||||
/>
|
||||
<div className="flex flex-col justify-center">
|
||||
<button onClick={() => onDeleteClick?.(product)}>Delete</button>
|
||||
<button onClick={() => onDeleteClick?.(model)}>Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -6,10 +6,10 @@ import ExploreModelFilter from "../ExploreModelFilter";
|
||||
const ExploreModelContainer: React.FC = () => (
|
||||
<div className="flex flex-col flex-1 px-16 pt-14 overflow-hidden">
|
||||
<HeaderTitle title="Explore Models" />
|
||||
<SearchBar
|
||||
{/* <SearchBar
|
||||
type={SearchType.Model}
|
||||
placeholder="Owner name like TheBloke, bhlim etc.."
|
||||
/>
|
||||
/> */}
|
||||
<div className="flex flex-1 gap-x-10 mt-9 overflow-hidden">
|
||||
<ExploreModelFilter />
|
||||
<ExploreModelList />
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import React from "react";
|
||||
import SearchBar from "../SearchBar";
|
||||
import SimpleCheckbox from "../SimpleCheckbox";
|
||||
import SimpleTag, { TagType } from "../SimpleTag";
|
||||
import SimpleTag from "../SimpleTag";
|
||||
import { TagType } from "../SimpleTag/TagType";
|
||||
|
||||
const tags = [
|
||||
"Roleplay",
|
||||
|
||||
@ -4,10 +4,20 @@
|
||||
|
||||
import ExploreModelItemHeader from "../ExploreModelItemHeader";
|
||||
import ModelVersionList from "../ModelVersionList";
|
||||
import { Fragment, forwardRef, useState } from "react";
|
||||
import SimpleTag, { TagType } from "../SimpleTag";
|
||||
import { Fragment, forwardRef, useEffect, useState } from "react";
|
||||
import SimpleTag from "../SimpleTag";
|
||||
import {
|
||||
MiscellanousTag,
|
||||
NumOfBit,
|
||||
QuantMethodTag,
|
||||
RamRequired,
|
||||
UsecaseTag,
|
||||
VersionTag,
|
||||
} from "@/_components/SimpleTag/TagType";
|
||||
import { displayDate } from "@/_utils/datetime";
|
||||
import { Product } from "@/_models/Product";
|
||||
import useGetMostSuitableModelVersion from "@/_hooks/useGetMostSuitableModelVersion";
|
||||
import { toGigabytes } from "@/_utils/converter";
|
||||
|
||||
type Props = {
|
||||
model: Product;
|
||||
@ -16,42 +26,33 @@ type Props = {
|
||||
const ExploreModelItem = forwardRef<HTMLDivElement, Props>(({ model }, ref) => {
|
||||
const [show, setShow] = useState(false);
|
||||
|
||||
const { availableVersions } = model;
|
||||
const { suitableModel, getMostSuitableModelVersion } =
|
||||
useGetMostSuitableModelVersion();
|
||||
|
||||
useEffect(() => {
|
||||
getMostSuitableModelVersion(availableVersions);
|
||||
}, [availableVersions]);
|
||||
|
||||
if (!suitableModel) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { quantMethod, bits, maxRamRequired, usecase } = suitableModel;
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={ref}
|
||||
className="flex flex-col border border-gray-200 rounded-md mb-4"
|
||||
>
|
||||
<ExploreModelItemHeader
|
||||
name={model.name}
|
||||
status={TagType.Recommended}
|
||||
versions={model.availableVersions}
|
||||
suitableModel={suitableModel}
|
||||
exploreModel={model}
|
||||
/>
|
||||
<div className="flex flex-col px-[26px] py-[22px]">
|
||||
<div className="flex justify-between">
|
||||
<div className="flex-1 flex flex-col gap-8">
|
||||
<div className="flex flex-col gap-1">
|
||||
<div className="text-sm font-medium text-gray-500">
|
||||
Model Format
|
||||
</div>
|
||||
<div className="px-2.5 py-0.5 bg-gray-100 text-xs text-gray-800 w-fit">
|
||||
GGUF
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
<div className="text-sm font-medium text-gray-500">
|
||||
Hardware Compatibility
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<SimpleTag
|
||||
clickable={false}
|
||||
title={TagType.Compatible}
|
||||
type={TagType.Compatible}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-1 flex flex-col gap-8">
|
||||
<div>
|
||||
<div className="text-sm font-medium text-gray-500">
|
||||
Release Date
|
||||
</div>
|
||||
@ -60,14 +61,49 @@ const ExploreModelItem = forwardRef<HTMLDivElement, Props>(({ model }, ref) => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="text-sm font-medium text-gray-500">
|
||||
Expected Performance
|
||||
<div className="text-sm font-medium text-gray-500">Version</div>
|
||||
<div className="flex gap-2">
|
||||
<SimpleTag
|
||||
title={model.version}
|
||||
type={VersionTag.Version}
|
||||
clickable={false}
|
||||
/>
|
||||
<SimpleTag
|
||||
title={quantMethod}
|
||||
type={QuantMethodTag.Default}
|
||||
clickable={false}
|
||||
/>
|
||||
<SimpleTag
|
||||
title={`${bits} Bits`}
|
||||
type={NumOfBit.Default}
|
||||
clickable={false}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-1 flex flex-col gap-8">
|
||||
<div>
|
||||
<div className="text-sm font-medium text-gray-500">Author</div>
|
||||
<div className="text-sm font-normal text-gray-900">
|
||||
{model.author}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="text-sm font-medium text-gray-500">
|
||||
Compatibility
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<SimpleTag
|
||||
title={usecase}
|
||||
type={UsecaseTag.UsecaseDefault}
|
||||
clickable={false}
|
||||
/>
|
||||
<SimpleTag
|
||||
title={`${toGigabytes(maxRamRequired)} RAM required`}
|
||||
type={RamRequired.RamDefault}
|
||||
clickable={false}
|
||||
/>
|
||||
</div>
|
||||
<SimpleTag
|
||||
title={TagType.Medium}
|
||||
type={TagType.Medium}
|
||||
clickable={false}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -77,16 +113,27 @@ const ExploreModelItem = forwardRef<HTMLDivElement, Props>(({ model }, ref) => {
|
||||
{model.longDescription}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
<div className="flex flex-col mt-5 gap-2">
|
||||
<span className="text-sm font-medium text-gray-500">Tags</span>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{model.tags.map((tag) => (
|
||||
<SimpleTag
|
||||
key={tag}
|
||||
title={tag}
|
||||
type={MiscellanousTag.MiscellanousDefault}
|
||||
clickable={false}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{model.availableVersions.length > 0 && (
|
||||
{model.availableVersions?.length > 0 && (
|
||||
<Fragment>
|
||||
{show && (
|
||||
<ModelVersionList
|
||||
model={model}
|
||||
versions={model.availableVersions}
|
||||
recommendedVersion={suitableModel?._id ?? ""}
|
||||
/>
|
||||
)}
|
||||
<button
|
||||
|
||||
@ -1,34 +1,74 @@
|
||||
import SimpleTag, { TagType } from "../SimpleTag";
|
||||
import SimpleTag from "../SimpleTag";
|
||||
import PrimaryButton from "../PrimaryButton";
|
||||
import { formatDownloadPercentage, toGigabytes } from "@/_utils/converter";
|
||||
import { DownloadState } from "@/_models/DownloadState";
|
||||
import SecondaryButton from "../SecondaryButton";
|
||||
import { ModelVersion } from "@/_models/Product";
|
||||
import { Product } from "@/_models/Product";
|
||||
import { useCallback, useEffect, useMemo } from "react";
|
||||
import { ModelVersion } from "@/_models/ModelVersion";
|
||||
import useGetPerformanceTag from "@/_hooks/useGetPerformanceTag";
|
||||
import useDownloadModel from "@/_hooks/useDownloadModel";
|
||||
import { useGetDownloadedModels } from "@/_hooks/useGetDownloadedModels";
|
||||
import { modelDownloadStateAtom } from "@/_helpers/atoms/DownloadState.atom";
|
||||
import { atom, useAtomValue, useSetAtom } from "jotai";
|
||||
import {
|
||||
MainViewState,
|
||||
setMainViewStateAtom,
|
||||
} from "@/_helpers/atoms/MainView.atom";
|
||||
|
||||
type Props = {
|
||||
name: string;
|
||||
status: TagType;
|
||||
versions: ModelVersion[];
|
||||
size?: number;
|
||||
downloadState?: DownloadState;
|
||||
onDownloadClick?: () => void;
|
||||
suitableModel: ModelVersion;
|
||||
exploreModel: Product;
|
||||
};
|
||||
|
||||
const ExploreModelItemHeader: React.FC<Props> = ({
|
||||
name,
|
||||
status,
|
||||
size,
|
||||
versions,
|
||||
downloadState,
|
||||
onDownloadClick,
|
||||
suitableModel,
|
||||
exploreModel,
|
||||
}) => {
|
||||
const { downloadModel } = useDownloadModel();
|
||||
const { downloadedModels } = useGetDownloadedModels();
|
||||
const { performanceTag, title, getPerformanceForModel } =
|
||||
useGetPerformanceTag();
|
||||
const downloadAtom = useMemo(
|
||||
() => atom((get) => get(modelDownloadStateAtom)[suitableModel._id]),
|
||||
[suitableModel._id]
|
||||
);
|
||||
const downloadState = useAtomValue(downloadAtom);
|
||||
const setMainViewState = useSetAtom(setMainViewStateAtom);
|
||||
|
||||
useEffect(() => {
|
||||
getPerformanceForModel(suitableModel);
|
||||
}, [suitableModel]);
|
||||
|
||||
const onDownloadClick = useCallback(() => {
|
||||
downloadModel(exploreModel, suitableModel);
|
||||
}, [exploreModel, suitableModel]);
|
||||
|
||||
const isDownloaded =
|
||||
downloadedModels.find((model) => model._id === suitableModel._id) != null;
|
||||
|
||||
let downloadButton = (
|
||||
<PrimaryButton
|
||||
title={size ? `Download (${toGigabytes(size)})` : "Download"}
|
||||
onClick={() => onDownloadClick?.()}
|
||||
title={
|
||||
suitableModel.size
|
||||
? `Download (${toGigabytes(suitableModel.size)})`
|
||||
: "Download"
|
||||
}
|
||||
onClick={() => onDownloadClick()}
|
||||
/>
|
||||
);
|
||||
|
||||
if (isDownloaded) {
|
||||
downloadButton = (
|
||||
<PrimaryButton
|
||||
title="View Downloaded Model"
|
||||
onClick={() => {
|
||||
setMainViewState(MainViewState.MyModel);
|
||||
}}
|
||||
className="bg-green-500 hover:bg-green-400"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (downloadState != null) {
|
||||
// downloading
|
||||
downloadButton = (
|
||||
@ -39,15 +79,15 @@ const ExploreModelItemHeader: React.FC<Props> = ({
|
||||
)})`}
|
||||
/>
|
||||
);
|
||||
} else if (versions.length === 0) {
|
||||
downloadButton = <SecondaryButton disabled title="No files available" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-between p-4 border-b border-gray-200">
|
||||
<div className="flex items-center gap-2">
|
||||
<span>{name}</span>
|
||||
<SimpleTag title={status} type={status} clickable={false} />
|
||||
<span>{exploreModel.name}</span>
|
||||
{performanceTag && (
|
||||
<SimpleTag title={title} type={performanceTag} clickable={false} />
|
||||
)}
|
||||
</div>
|
||||
{downloadButton}
|
||||
</div>
|
||||
|
||||
@ -1,50 +1,26 @@
|
||||
import React, { useEffect } from "react";
|
||||
import ExploreModelItem from "../ExploreModelItem";
|
||||
import { modelSearchAtom } from "@/_helpers/JotaiWrapper";
|
||||
import useGetHuggingFaceModel from "@/_hooks/useGetHuggingFaceModel";
|
||||
import { useAtom, useAtomValue } from "jotai";
|
||||
import { useInView } from "react-intersection-observer";
|
||||
import { modelLoadMoreAtom } from "@/_helpers/atoms/ExploreModelLoading.atom";
|
||||
import { getConfiguredModels } from "@/_hooks/useGetDownloadedModels";
|
||||
import useGetConfiguredModels from "@/_hooks/useGetConfiguredModels";
|
||||
import { Waveform } from "@uiball/loaders";
|
||||
|
||||
const ExploreModelList: React.FC = () => {
|
||||
const [loadMoreInProgress, setLoadMoreInProress] = useAtom(modelLoadMoreAtom);
|
||||
const modelSearch = useAtomValue(modelSearchAtom);
|
||||
const { modelList, getHuggingFaceModel } = useGetHuggingFaceModel();
|
||||
const { ref, inView } = useInView({
|
||||
threshold: 0,
|
||||
triggerOnce: true,
|
||||
});
|
||||
const { loading, models } = useGetConfiguredModels();
|
||||
|
||||
useEffect(() => {
|
||||
if (modelList.length === 0 && modelSearch.length > 0) {
|
||||
setLoadMoreInProress(true);
|
||||
}
|
||||
getHuggingFaceModel(modelSearch);
|
||||
}, [modelSearch]);
|
||||
|
||||
useEffect(() => {
|
||||
if (inView) {
|
||||
console.debug("Load more models..");
|
||||
setLoadMoreInProress(true);
|
||||
getHuggingFaceModel(modelSearch);
|
||||
}
|
||||
}, [inView]);
|
||||
getConfiguredModels();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col flex-1 overflow-y-auto scroll">
|
||||
{modelList.map((item, index) => (
|
||||
<ExploreModelItem
|
||||
ref={index === modelList.length - 1 ? ref : null}
|
||||
key={item.id}
|
||||
model={item}
|
||||
/>
|
||||
))}
|
||||
{loadMoreInProgress && (
|
||||
<div className="mx-auto mt-2 mb-4">
|
||||
<Waveform size={24} color="#9CA3AF" />
|
||||
{loading && (
|
||||
<div className="mx-auto">
|
||||
<Waveform size={24} color="#CBD5E0" />
|
||||
</div>
|
||||
)}
|
||||
{models.map((item) => (
|
||||
<ExploreModelItem key={item._id} model={item} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,25 +1,28 @@
|
||||
import React from "react";
|
||||
import JanImage from "../JanImage";
|
||||
import { useAtomValue, useSetAtom } from "jotai";
|
||||
import Image from "next/image";
|
||||
import { Conversation } from "@/_models/Conversation";
|
||||
import { DataService } from "../../../shared/coreService";
|
||||
import { ModelManagementService } from "@janhq/plugin-core";
|
||||
import { executeSerial } from "../../../../electron/core/plugin-manager/execution/extension-manager";
|
||||
import {
|
||||
conversationStatesAtom,
|
||||
getActiveConvoIdAtom,
|
||||
setActiveConvoIdAtom,
|
||||
updateConversationErrorAtom,
|
||||
updateConversationWaitingForResponseAtom,
|
||||
} from "@/_helpers/atoms/Conversation.atom";
|
||||
import {
|
||||
setMainViewStateAtom,
|
||||
MainViewState,
|
||||
} from "@/_helpers/atoms/MainView.atom";
|
||||
import useInitModel from "@/_hooks/useInitModel";
|
||||
import { displayDate } from "@/_utils/datetime";
|
||||
|
||||
type Props = {
|
||||
conversation: Conversation;
|
||||
avatarUrl?: string;
|
||||
name: string;
|
||||
summary?: string;
|
||||
updatedAt?: string;
|
||||
};
|
||||
|
||||
@ -27,31 +30,39 @@ const HistoryItem: React.FC<Props> = ({
|
||||
conversation,
|
||||
avatarUrl,
|
||||
name,
|
||||
summary,
|
||||
updatedAt,
|
||||
}) => {
|
||||
const setMainViewState = useSetAtom(setMainViewStateAtom);
|
||||
const conversationStates = useAtomValue(conversationStatesAtom);
|
||||
const activeConvoId = useAtomValue(getActiveConvoIdAtom);
|
||||
const setActiveConvoId = useSetAtom(setActiveConvoIdAtom);
|
||||
const isSelected = activeConvoId === conversation.id;
|
||||
const updateConvWaiting = useSetAtom(
|
||||
updateConversationWaitingForResponseAtom
|
||||
);
|
||||
const updateConvError = useSetAtom(updateConversationErrorAtom);
|
||||
const isSelected = activeConvoId === conversation._id;
|
||||
|
||||
const { initModel } = useInitModel();
|
||||
|
||||
const onClick = async () => {
|
||||
const model = await executeSerial(
|
||||
DataService.GET_MODEL_BY_ID,
|
||||
conversation.model_id
|
||||
ModelManagementService.GetModelById,
|
||||
conversation.modelId
|
||||
);
|
||||
if (!model) {
|
||||
alert(
|
||||
`Model ${conversation.model_id} not found! Please re-download the model first.`
|
||||
);
|
||||
} else {
|
||||
initModel(model);
|
||||
}
|
||||
if (activeConvoId !== conversation.id) {
|
||||
|
||||
if (conversation._id) updateConvWaiting(conversation._id, true);
|
||||
initModel(model).then((res: any) => {
|
||||
if (conversation._id) updateConvWaiting(conversation._id, false);
|
||||
|
||||
if (res?.error && conversation._id) {
|
||||
updateConvError(conversation._id, res.error);
|
||||
}
|
||||
});
|
||||
|
||||
if (activeConvoId !== conversation._id) {
|
||||
setMainViewState(MainViewState.Conversation);
|
||||
setActiveConvoId(conversation.id);
|
||||
setActiveConvoId(conversation._id);
|
||||
}
|
||||
};
|
||||
|
||||
@ -60,53 +71,43 @@ const HistoryItem: React.FC<Props> = ({
|
||||
: "bg-white dark:bg-gray-500";
|
||||
|
||||
let rightImageUrl: string | undefined;
|
||||
if (conversationStates[conversation.id ?? ""]?.waitingForResponse === true) {
|
||||
if (conversationStates[conversation._id ?? ""]?.waitingForResponse === true) {
|
||||
rightImageUrl = "icons/loading.svg";
|
||||
}
|
||||
|
||||
const description = conversation?.lastMessage ?? "No new message";
|
||||
|
||||
return (
|
||||
<button
|
||||
className={`flex flex-row mx-1 items-center gap-2.5 rounded-lg p-2 ${backgroundColor} hover:bg-hover-light`}
|
||||
<li
|
||||
role="button"
|
||||
className={`flex flex-row ml-3 mr-2 rounded p-3 ${backgroundColor} hover:bg-hover-light`}
|
||||
onClick={onClick}
|
||||
>
|
||||
<Image
|
||||
width={36}
|
||||
height={36}
|
||||
src={avatarUrl ?? "icons/app_icon.svg"}
|
||||
className="w-9 aspect-square rounded-full"
|
||||
alt=""
|
||||
/>
|
||||
<div className="flex flex-col justify-between text-sm leading-[20px] w-full">
|
||||
<div className="flex flex-row items-center justify-between">
|
||||
<span className="text-gray-900 text-left">{name}</span>
|
||||
<span className="text-xs leading-[13px] tracking-[-0.4px] text-gray-400">
|
||||
{updatedAt && new Date(updatedAt).toDateString()}
|
||||
<div className="w-8 h-8">
|
||||
<Image
|
||||
width={32}
|
||||
height={32}
|
||||
src={avatarUrl ?? "icons/app_icon.svg"}
|
||||
className="aspect-square rounded-full"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col ml-2 flex-1">
|
||||
{/* title */}
|
||||
<div className="flex">
|
||||
<span className="flex-1 text-gray-900 line-clamp-1">
|
||||
{summary ?? name}
|
||||
</span>
|
||||
<span className="text-xs leading-5 text-gray-500 line-clamp-1">
|
||||
{updatedAt && displayDate(new Date(updatedAt).getTime())}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between gap-1">
|
||||
<div className="flex-1">
|
||||
<span className="text-gray-400 hidden-text text-left">
|
||||
{conversation?.message ?? (
|
||||
<span>
|
||||
No new message
|
||||
<br className="h-5 block" />
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
<>
|
||||
{rightImageUrl != null ? (
|
||||
<JanImage
|
||||
imageUrl={rightImageUrl ?? ""}
|
||||
className="rounded"
|
||||
width={24}
|
||||
height={24}
|
||||
/>
|
||||
) : undefined}
|
||||
</>
|
||||
</div>
|
||||
|
||||
{/* description */}
|
||||
<span className="mt-1 text-gray-400 line-clamp-2">{description}</span>
|
||||
</div>
|
||||
</button>
|
||||
</li>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -24,8 +24,10 @@ const HistoryList: React.FC = () => {
|
||||
expanded={expand}
|
||||
onClick={() => setExpand(!expand)}
|
||||
/>
|
||||
<div
|
||||
className={`flex flex-col gap-1 mt-1 overflow-y-auto scroll ${!expand ? "hidden " : "block"}`}
|
||||
<ul
|
||||
className={`flex flex-col gap-1 mt-1 overflow-y-auto scroll ${
|
||||
!expand ? "hidden " : "block"
|
||||
}`}
|
||||
>
|
||||
{conversations.length > 0 ? (
|
||||
conversations
|
||||
@ -36,17 +38,18 @@ const HistoryList: React.FC = () => {
|
||||
)
|
||||
.map((convo) => (
|
||||
<HistoryItem
|
||||
key={convo.id}
|
||||
key={convo._id}
|
||||
conversation={convo}
|
||||
summary={convo.summary}
|
||||
avatarUrl={convo.image}
|
||||
name={convo.name || "Jan"}
|
||||
updatedAt={convo.updated_at ?? ""}
|
||||
updatedAt={convo.updatedAt ?? ""}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
<SidebarEmptyHistory />
|
||||
)}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@ -8,15 +8,14 @@ import SecondaryButton from "../SecondaryButton";
|
||||
import { Fragment } from "react";
|
||||
import { PlusIcon } from "@heroicons/react/24/outline";
|
||||
import useCreateConversation from "@/_hooks/useCreateConversation";
|
||||
import { currentProductAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import { showingTyping } from "@/_helpers/JotaiWrapper";
|
||||
import LoadingIndicator from "../LoadingIndicator";
|
||||
import { activeAssistantModelAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import { currentConvoStateAtom } from "@/_helpers/atoms/Conversation.atom";
|
||||
|
||||
const InputToolbar: React.FC = () => {
|
||||
const showingAdvancedPrompt = useAtomValue(showingAdvancedPromptAtom);
|
||||
const currentProduct = useAtomValue(currentProductAtom);
|
||||
const activeModel = useAtomValue(activeAssistantModelAtom);
|
||||
const { requestCreateConvo } = useCreateConversation();
|
||||
const isTyping = useAtomValue(showingTyping);
|
||||
const currentConvoState = useAtomValue(currentConvoStateAtom);
|
||||
|
||||
if (showingAdvancedPrompt) {
|
||||
return <div />;
|
||||
@ -26,22 +25,21 @@ const InputToolbar: React.FC = () => {
|
||||
// const onRegenerateClick = () => {};
|
||||
|
||||
const onNewConversationClick = () => {
|
||||
if (currentProduct) {
|
||||
requestCreateConvo(currentProduct);
|
||||
if (activeModel) {
|
||||
requestCreateConvo(activeModel);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<div className="flex justify-between gap-2 mr-3 my-2">
|
||||
<div className="h-6">
|
||||
{isTyping && (
|
||||
<div className="my-2" key="indicator">
|
||||
<LoadingIndicator />
|
||||
</div>
|
||||
)}{" "}
|
||||
{currentConvoState?.error && (
|
||||
<div className="flex flex-row justify-center">
|
||||
<span className="mx-5 my-2 text-red-500 text-sm">
|
||||
{currentConvoState?.error?.toString()}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
)}
|
||||
<div className="flex justify-center gap-2 my-3">
|
||||
{/* <SecondaryButton title="Regenerate" onClick={onRegenerateClick} /> */}
|
||||
<SecondaryButton
|
||||
onClick={onNewConversationClick}
|
||||
@ -49,9 +47,12 @@ const InputToolbar: React.FC = () => {
|
||||
icon={<PlusIcon width={16} height={16} />}
|
||||
/>
|
||||
</div>
|
||||
<div className="mx-3 mb-3 flex-none overflow-hidden shadow-sm ring-1 ring-inset ring-gray-300 rounded-lg dark:bg-gray-800">
|
||||
<BasicPromptInput />
|
||||
<BasicPromptAccessories />
|
||||
{/* My text input */}
|
||||
<div className="flex items-start space-x-4 mx-12 md:mx-32 2xl:mx-64 mb-5">
|
||||
<div className="min-w-0 flex-1 relative">
|
||||
<BasicPromptInput />
|
||||
<BasicPromptAccessories />
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React from "react";
|
||||
import React, { Fragment } from "react";
|
||||
import SidebarFooter from "../SidebarFooter";
|
||||
import SidebarHeader from "../SidebarHeader";
|
||||
import SidebarMenu from "../SidebarMenu";
|
||||
@ -6,13 +6,13 @@ import HistoryList from "../HistoryList";
|
||||
import NewChatButton from "../NewChatButton";
|
||||
|
||||
const LeftContainer: React.FC = () => (
|
||||
<div className="w-[323px] flex-shrink-0 py-3 h-screen border-r border-gray-200 flex flex-col">
|
||||
<Fragment>
|
||||
<SidebarHeader />
|
||||
<NewChatButton />
|
||||
<HistoryList />
|
||||
<SidebarMenu />
|
||||
<SidebarFooter />
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
|
||||
export default React.memo(LeftContainer);
|
||||
|
||||
45
web/app/_components/MainContainer/index.tsx
Normal file
@ -0,0 +1,45 @@
|
||||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import LeftContainer from "../LeftContainer";
|
||||
import RightContainer from "../RightContainer";
|
||||
import { Variants, motion } from "framer-motion";
|
||||
import { useAtomValue } from "jotai";
|
||||
import { leftSideBarExpandStateAtom } from "@/_helpers/atoms/LeftSideBarExpand.atom";
|
||||
|
||||
const leftSideBarVariants: Variants = {
|
||||
show: {
|
||||
x: 0,
|
||||
width: 320,
|
||||
opacity: 1,
|
||||
transition: { duration: 0.1 },
|
||||
},
|
||||
hide: {
|
||||
x: "-100%",
|
||||
width: 0,
|
||||
opacity: 0,
|
||||
transition: { duration: 0.1 },
|
||||
},
|
||||
};
|
||||
|
||||
const MainContainer: React.FC = () => {
|
||||
const leftSideBarExpand = useAtomValue(leftSideBarExpandStateAtom);
|
||||
|
||||
return (
|
||||
<div className="flex">
|
||||
<motion.div
|
||||
initial={false}
|
||||
animate={leftSideBarExpand ? "show" : "hide"}
|
||||
variants={leftSideBarVariants}
|
||||
className="w-80 flex-shrink-0 py-3 h-screen border-r border-gray-200 flex flex-col"
|
||||
>
|
||||
<LeftContainer />
|
||||
</motion.div>
|
||||
<div className="flex flex-col flex-1 h-screen">
|
||||
<RightContainer />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default MainContainer;
|
||||
@ -1,67 +1,58 @@
|
||||
import React from "react";
|
||||
import { Product } from "@/_models/Product";
|
||||
import Image from "next/image";
|
||||
import React, { useCallback } from "react";
|
||||
import { ModelStatus, ModelStatusComponent } from "../ModelStatusComponent";
|
||||
import ModelActionMenu from "../ModelActionMenu";
|
||||
import { useAtomValue } from "jotai";
|
||||
import ModelActionButton, { ModelActionType } from "../ModelActionButton";
|
||||
import useStartStopModel from "@/_hooks/useStartStopModel";
|
||||
import useDeleteModel from "@/_hooks/useDeleteModel";
|
||||
import { currentProductAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import { AssistantModel } from "@/_models/AssistantModel";
|
||||
import { activeAssistantModelAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import { toGigabytes } from "@/_utils/converter";
|
||||
|
||||
type Props = {
|
||||
model: Product;
|
||||
model: AssistantModel;
|
||||
};
|
||||
|
||||
const ModelRow: React.FC<Props> = ({ model }) => {
|
||||
const { startModel, stopModel } = useStartStopModel();
|
||||
const activeModel = useAtomValue(currentProductAtom);
|
||||
const activeModel = useAtomValue(activeAssistantModelAtom);
|
||||
const { deleteModel } = useDeleteModel();
|
||||
|
||||
let status = ModelStatus.Installed;
|
||||
if (activeModel && activeModel.id === model.id) {
|
||||
if (activeModel && activeModel._id === model._id) {
|
||||
status = ModelStatus.Active;
|
||||
}
|
||||
|
||||
let actionButtonType = ModelActionType.Start;
|
||||
if (activeModel && activeModel.id === model.id) {
|
||||
if (activeModel && activeModel._id === model._id) {
|
||||
actionButtonType = ModelActionType.Stop;
|
||||
}
|
||||
|
||||
const onModelActionClick = (action: ModelActionType) => {
|
||||
if (action === ModelActionType.Start) {
|
||||
startModel(model.id);
|
||||
startModel(model._id);
|
||||
} else {
|
||||
stopModel(model.id);
|
||||
stopModel(model._id);
|
||||
}
|
||||
};
|
||||
|
||||
const onDeleteClick = () => {
|
||||
const onDeleteClick = useCallback(() => {
|
||||
deleteModel(model);
|
||||
};
|
||||
}, [model]);
|
||||
|
||||
return (
|
||||
<tr
|
||||
className="border-b border-gray-200 last:border-b-0 last:rounded-lg"
|
||||
key={model.id}
|
||||
>
|
||||
<tr className="border-b border-gray-200 last:border-b-0 last:rounded-lg">
|
||||
<td className="flex flex-col whitespace-nowrap px-6 py-4 text-sm font-medium text-gray-900">
|
||||
{model.name}
|
||||
<span className="text-gray-500 font-normal">{model.version}</span>
|
||||
</td>
|
||||
<td className="whitespace-nowrap px-6 py-4 text-sm text-gray-500">
|
||||
<div className="flex flex-col justify-start">
|
||||
<span>{model.format}</span>
|
||||
{model.accelerated && (
|
||||
<span className="flex items-center text-gray-500 text-sm font-normal gap-0.5">
|
||||
<Image src={"/icons/flash.svg"} width={20} height={20} alt="" />
|
||||
GPU Accelerated
|
||||
</span>
|
||||
)}
|
||||
<span>GGUF</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="whitespace-nowrap px-6 py-4 text-sm text-gray-500">
|
||||
{model.totalSize}
|
||||
{toGigabytes(model.size)}
|
||||
</td>
|
||||
<td className="whitespace-nowrap px-6 py-4 text-sm text-gray-500">
|
||||
<ModelStatusComponent status={status} />
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { Fragment, useEffect } from "react";
|
||||
import { Listbox, Transition } from "@headlessui/react";
|
||||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/react/20/solid";
|
||||
import { Product } from "@/_models/Product";
|
||||
import { useAtom, useAtomValue } from "jotai";
|
||||
import { selectedModelAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import { downloadedModelAtom } from "@/_helpers/atoms/DownloadedModel.atom";
|
||||
import { AssistantModel } from "@/_models/AssistantModel";
|
||||
|
||||
function classNames(...classes: any) {
|
||||
return classes.filter(Boolean).join(" ");
|
||||
@ -20,7 +20,7 @@ const SelectModels: React.FC = () => {
|
||||
}
|
||||
}, [downloadedModels]);
|
||||
|
||||
const onModelSelected = (model: Product) => {
|
||||
const onModelSelected = (model: AssistantModel) => {
|
||||
setSelectedModel(model);
|
||||
};
|
||||
|
||||
@ -65,7 +65,7 @@ const SelectModels: React.FC = () => {
|
||||
<Listbox.Options className="absolute z-10 mt-1 max-h-[188px] w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm">
|
||||
{downloadedModels.map((model) => (
|
||||
<Listbox.Option
|
||||
key={model.id}
|
||||
key={model._id}
|
||||
className={({ active }) =>
|
||||
classNames(
|
||||
active ? "bg-blue-600 text-white" : "text-gray-900",
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { Product } from "@/_models/Product";
|
||||
import ModelRow from "../ModelRow";
|
||||
import ModelTableHeader from "../ModelTableHeader";
|
||||
import { AssistantModel } from "@/_models/AssistantModel";
|
||||
|
||||
type Props = {
|
||||
models: Product[];
|
||||
models: AssistantModel[];
|
||||
};
|
||||
|
||||
const tableHeaders = ["MODEL", "FORMAT", "SIZE", "STATUS", "ACTIONS"];
|
||||
@ -24,7 +24,7 @@ const ModelTable: React.FC<Props> = ({ models }) => (
|
||||
</thead>
|
||||
<tbody>
|
||||
{models.map((model) => (
|
||||
<ModelRow key={model.id} model={model} />
|
||||
<ModelRow key={model._id} model={model} />
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -1,26 +1,39 @@
|
||||
import React, { useMemo } from "react";
|
||||
import { formatDownloadPercentage, toGigabytes } from "@/_utils/converter";
|
||||
import Image from "next/image";
|
||||
import { ModelVersion, Product } from "@/_models/Product";
|
||||
import { Product } from "@/_models/Product";
|
||||
import useDownloadModel from "@/_hooks/useDownloadModel";
|
||||
import { modelDownloadStateAtom } from "@/_helpers/atoms/DownloadState.atom";
|
||||
import { atom, useAtomValue } from "jotai";
|
||||
import { ModelVersion } from "@/_models/ModelVersion";
|
||||
import { useGetDownloadedModels } from "@/_hooks/useGetDownloadedModels";
|
||||
import SimpleTag from "../SimpleTag";
|
||||
import { RamRequired, UsecaseTag } from "../SimpleTag/TagType";
|
||||
|
||||
type Props = {
|
||||
model: Product;
|
||||
modelVersion: ModelVersion;
|
||||
isRecommended: boolean;
|
||||
};
|
||||
|
||||
const ModelVersionItem: React.FC<Props> = ({ model, modelVersion }) => {
|
||||
const { downloadHfModel } = useDownloadModel();
|
||||
const ModelVersionItem: React.FC<Props> = ({
|
||||
model,
|
||||
modelVersion,
|
||||
isRecommended,
|
||||
}) => {
|
||||
const { downloadModel } = useDownloadModel();
|
||||
const { downloadedModels } = useGetDownloadedModels();
|
||||
const isDownloaded =
|
||||
downloadedModels.find((model) => model._id === modelVersion._id) != null;
|
||||
|
||||
const downloadAtom = useMemo(
|
||||
() => atom((get) => get(modelDownloadStateAtom)[modelVersion.path ?? ""]),
|
||||
[modelVersion.path ?? ""]
|
||||
() => atom((get) => get(modelDownloadStateAtom)[modelVersion._id ?? ""]),
|
||||
[modelVersion._id]
|
||||
);
|
||||
const downloadState = useAtomValue(downloadAtom);
|
||||
|
||||
const onDownloadClick = () => {
|
||||
downloadHfModel(model, modelVersion);
|
||||
downloadModel(model, modelVersion);
|
||||
};
|
||||
|
||||
let downloadButton = (
|
||||
@ -36,15 +49,33 @@ const ModelVersionItem: React.FC<Props> = ({ model, modelVersion }) => {
|
||||
downloadButton = (
|
||||
<div>{formatDownloadPercentage(downloadState.percent)}</div>
|
||||
);
|
||||
} else if (isDownloaded) {
|
||||
downloadButton = <div>Downloaded</div>;
|
||||
}
|
||||
|
||||
const { maxRamRequired, usecase } = modelVersion;
|
||||
|
||||
return (
|
||||
<div className="flex justify-between items-center gap-4 pl-3 pt-3 pr-4 pb-3 border-t border-gray-200 first:border-t-0">
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<Image src={"/icons/app_icon.svg"} width={14} height={20} alt="" />
|
||||
<span className="font-sm text-gray-900">{modelVersion.path}</span>
|
||||
<span className="font-sm text-gray-900 flex-1">
|
||||
{modelVersion.name}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="flex gap-2 justify-end">
|
||||
<SimpleTag
|
||||
title={usecase}
|
||||
type={UsecaseTag.UsecaseDefault}
|
||||
clickable={false}
|
||||
/>
|
||||
<SimpleTag
|
||||
title={`${toGigabytes(maxRamRequired)} RAM required`}
|
||||
type={RamRequired.RamDefault}
|
||||
clickable={false}
|
||||
/>
|
||||
</div>
|
||||
<div className="px-2.5 py-0.5 bg-gray-200 text-xs font-medium rounded">
|
||||
{toGigabytes(modelVersion.size)}
|
||||
</div>
|
||||
|
||||
@ -1,21 +1,36 @@
|
||||
import React from "react";
|
||||
import ModelVersionItem from "../ModelVersionItem";
|
||||
import { ModelVersion, Product } from "@/_models/Product";
|
||||
import { Product } from "@/_models/Product";
|
||||
import { ModelVersion } from "@/_models/ModelVersion";
|
||||
|
||||
type Props = {
|
||||
model: Product;
|
||||
versions: ModelVersion[];
|
||||
recommendedVersion: string;
|
||||
};
|
||||
|
||||
const ModelVersionList: React.FC<Props> = ({ model, versions }) => (
|
||||
<div className="px-4 py-5 border-t border-gray-200">
|
||||
<div className="text-sm font-medium text-gray-500">Available Versions</div>
|
||||
<div className="border border-gray-200 rounded-lg overflow-hidden">
|
||||
{versions.map((item) => (
|
||||
<ModelVersionItem key={item.path} model={model} modelVersion={item} />
|
||||
))}
|
||||
const ModelVersionList: React.FC<Props> = ({
|
||||
model,
|
||||
versions,
|
||||
recommendedVersion,
|
||||
}) => {
|
||||
return (
|
||||
<div className="px-4 py-5 border-t border-gray-200">
|
||||
<div className="text-sm font-medium text-gray-500">
|
||||
Available Versions
|
||||
</div>
|
||||
<div className="border border-gray-200 rounded-lg overflow-hidden">
|
||||
{versions.map((item) => (
|
||||
<ModelVersionItem
|
||||
key={item._id}
|
||||
model={model}
|
||||
modelVersion={item}
|
||||
isRecommended={item._id === recommendedVersion}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
};
|
||||
|
||||
export default ModelVersionList;
|
||||
|
||||
@ -2,16 +2,16 @@ import ProgressBar from "../ProgressBar";
|
||||
import SystemItem from "../SystemItem";
|
||||
import { useAtomValue } from "jotai";
|
||||
import { appDownloadProgress } from "@/_helpers/JotaiWrapper";
|
||||
import { currentProductAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import useGetAppVersion from "@/_hooks/useGetAppVersion";
|
||||
import useGetSystemResources from "@/_hooks/useGetSystemResources";
|
||||
import { modelDownloadStateAtom } from "@/_helpers/atoms/DownloadState.atom";
|
||||
import { DownloadState } from "@/_models/DownloadState";
|
||||
import { formatDownloadPercentage } from "@/_utils/converter";
|
||||
import { activeAssistantModelAtom } from "@/_helpers/atoms/Model.atom";
|
||||
|
||||
const MonitorBar: React.FC = () => {
|
||||
const progress = useAtomValue(appDownloadProgress);
|
||||
const activeModel = useAtomValue(currentProductAtom);
|
||||
const activeModel = useAtomValue(activeAssistantModelAtom);
|
||||
const { version } = useGetAppVersion();
|
||||
const { ram, cpu } = useGetSystemResources();
|
||||
const modelDownloadStates = useAtomValue(modelDownloadStateAtom);
|
||||
|
||||
@ -7,14 +7,14 @@ import {
|
||||
MainViewState,
|
||||
setMainViewStateAtom,
|
||||
} from "@/_helpers/atoms/MainView.atom";
|
||||
import { currentProductAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import useCreateConversation from "@/_hooks/useCreateConversation";
|
||||
import useInitModel from "@/_hooks/useInitModel";
|
||||
import { Product } from "@/_models/Product";
|
||||
import { PlusIcon } from "@heroicons/react/24/outline";
|
||||
import { activeAssistantModelAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import { AssistantModel } from "@/_models/AssistantModel";
|
||||
|
||||
const NewChatButton: React.FC = () => {
|
||||
const activeModel = useAtomValue(currentProductAtom);
|
||||
const activeModel = useAtomValue(activeAssistantModelAtom);
|
||||
const setMainView = useSetAtom(setMainViewStateAtom);
|
||||
const { requestCreateConvo } = useCreateConversation();
|
||||
const { initModel } = useInitModel();
|
||||
@ -27,7 +27,7 @@ const NewChatButton: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const createConversationAndInitModel = async (model: Product) => {
|
||||
const createConversationAndInitModel = async (model: AssistantModel) => {
|
||||
await requestCreateConvo(model);
|
||||
await initModel(model);
|
||||
};
|
||||
|
||||
@ -105,7 +105,7 @@ export const Preferences = () => {
|
||||
if (typeof window !== "undefined") {
|
||||
// @ts-ignore
|
||||
await window.pluggableElectronIpc.update([plugin], true);
|
||||
window.electronAPI.relaunch();
|
||||
window.electronAPI.reloadPlugins();
|
||||
}
|
||||
// plugins.update(active.map((plg) => plg.name));
|
||||
};
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
import { Fragment } from "react";
|
||||
import MainView from "../MainView";
|
||||
import MonitorBar from "../MonitorBar";
|
||||
|
||||
const RightContainer = () => (
|
||||
<div className="flex flex-col flex-1 h-screen">
|
||||
<Fragment>
|
||||
<MainView />
|
||||
<MonitorBar />
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
|
||||
export default RightContainer;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { currentPromptAtom } from "@/_helpers/JotaiWrapper";
|
||||
import { currentConvoStateAtom } from "@/_helpers/atoms/Conversation.atom";
|
||||
import useSendChatMessage from "@/_hooks/useSendChatMessage";
|
||||
import { ArrowRightIcon } from "@heroicons/react/24/outline";
|
||||
import { useAtom, useAtomValue } from "jotai";
|
||||
|
||||
const SendButton: React.FC = () => {
|
||||
@ -12,10 +11,6 @@ const SendButton: React.FC = () => {
|
||||
const isWaitingForResponse = currentConvoState?.waitingForResponse ?? false;
|
||||
const disabled = currentPrompt.trim().length === 0 || isWaitingForResponse;
|
||||
|
||||
const enabledStyle = {
|
||||
backgroundColor: "#FACA15",
|
||||
};
|
||||
|
||||
const disabledStyle = {
|
||||
backgroundColor: "#F3F4F6",
|
||||
};
|
||||
@ -23,11 +18,11 @@ const SendButton: React.FC = () => {
|
||||
return (
|
||||
<button
|
||||
onClick={sendChatMessage}
|
||||
style={disabled ? disabledStyle : enabledStyle}
|
||||
style={disabled ? disabledStyle : {}}
|
||||
type="submit"
|
||||
className="p-2 gap-2.5 inline-flex items-center rounded-xl text-sm font-semibold shadow-sm hover:bg-blue-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600"
|
||||
className="inline-flex items-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
|
||||
>
|
||||
<ArrowRightIcon width={16} height={16} />
|
||||
Send
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
@ -7,10 +7,10 @@ import {
|
||||
MainViewState,
|
||||
setMainViewStateAtom,
|
||||
} from "@/_helpers/atoms/MainView.atom";
|
||||
import { currentProductAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import { activeAssistantModelAtom } from "@/_helpers/atoms/Model.atom";
|
||||
import useInitModel from "@/_hooks/useInitModel";
|
||||
import { Product } from "@/_models/Product";
|
||||
import { useGetDownloadedModels } from "@/_hooks/useGetDownloadedModels";
|
||||
import { AssistantModel } from "@/_models/AssistantModel";
|
||||
|
||||
enum ActionButton {
|
||||
DownloadModel = "Download a Model",
|
||||
@ -19,7 +19,7 @@ enum ActionButton {
|
||||
|
||||
const SidebarEmptyHistory: React.FC = () => {
|
||||
const { downloadedModels } = useGetDownloadedModels();
|
||||
const activeModel = useAtomValue(currentProductAtom);
|
||||
const activeModel = useAtomValue(activeAssistantModelAtom);
|
||||
const setMainView = useSetAtom(setMainViewStateAtom);
|
||||
const { requestCreateConvo } = useCreateConversation();
|
||||
const [action, setAction] = useState(ActionButton.DownloadModel);
|
||||
@ -46,7 +46,7 @@ const SidebarEmptyHistory: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const createConversationAndInitModel = async (model: Product) => {
|
||||
const createConversationAndInitModel = async (model: AssistantModel) => {
|
||||
await requestCreateConvo(model);
|
||||
await initModel(model);
|
||||
};
|
||||
|
||||
21
web/app/_components/SimpleTag/TagStyleMapper.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { TagType } from "./TagType";
|
||||
|
||||
export const tagStyleMapper: Record<TagType, string> = {
|
||||
GGUF: "bg-yellow-100 text-yellow-800",
|
||||
PerformancePositive:
|
||||
"text-green-700 ring-1 ring-inset ring-green-600/20 bg-green-50",
|
||||
PerformanceNeutral:
|
||||
"bg-yellow-50 text-yellow-800 ring-1 ring-inset ring-yellow-600/20",
|
||||
PerformanceNegative:
|
||||
"bg-red-50 ext-red-700 ring-1 ring-inset ring-red-600/10",
|
||||
HardwareCompatible: "bg-red-50 ext-red-700 ring-1 ring-inset ring-red-600/10",
|
||||
HardwareIncompatible:
|
||||
"bg-red-50 ext-red-700 ring-1 ring-inset ring-red-600/10",
|
||||
FreeStyle: "bg-gray-100 text-gray-800",
|
||||
ExpectPerformanceMedium: "bg-yellow-100 text-yellow-800",
|
||||
Version: "bg-red-100 text-yellow-800",
|
||||
Default: "bg-blue-100 text-blue-800",
|
||||
RamDefault: "bg-green-50 text-green-700",
|
||||
UsecaseDefault: "bg-orange-100 text-yellow-800",
|
||||
MiscellanousDefault: "bg-blue-100 text-blue-800",
|
||||
};
|
||||
62
web/app/_components/SimpleTag/TagType.ts
Normal file
@ -0,0 +1,62 @@
|
||||
export enum ModelPerformance {
|
||||
PerformancePositive = "PerformancePositive",
|
||||
|
||||
PerformanceNeutral = "PerformanceNeutral",
|
||||
|
||||
PerformanceNegative = "PerformanceNegative",
|
||||
}
|
||||
|
||||
export enum HardwareCompatibility {
|
||||
HardwareCompatible = "HardwareCompatible",
|
||||
|
||||
HardwareIncompatible = "HardwareIncompatible",
|
||||
}
|
||||
|
||||
export enum ExpectedPerformance {
|
||||
ExpectPerformanceMedium = "ExpectPerformanceMedium",
|
||||
}
|
||||
|
||||
export enum ModelFormat {
|
||||
GGUF = "GGUF",
|
||||
}
|
||||
|
||||
export enum FreestyleTag {
|
||||
FreeStyle = "FreeStyle",
|
||||
}
|
||||
|
||||
export enum VersionTag {
|
||||
Version = "Version",
|
||||
}
|
||||
|
||||
export enum QuantMethodTag {
|
||||
Default = "Default",
|
||||
}
|
||||
|
||||
export enum NumOfBit {
|
||||
Default = "Default",
|
||||
}
|
||||
|
||||
export enum RamRequired {
|
||||
RamDefault = "RamDefault",
|
||||
}
|
||||
|
||||
export enum UsecaseTag {
|
||||
UsecaseDefault = "UsecaseDefault",
|
||||
}
|
||||
|
||||
export enum MiscellanousTag {
|
||||
MiscellanousDefault = "MiscellanousDefault",
|
||||
}
|
||||
|
||||
export type TagType =
|
||||
| ModelPerformance
|
||||
| HardwareCompatibility
|
||||
| ExpectedPerformance
|
||||
| ModelFormat
|
||||
| FreestyleTag
|
||||
| VersionTag
|
||||
| QuantMethodTag
|
||||
| NumOfBit
|
||||
| RamRequired
|
||||
| UsecaseTag
|
||||
| MiscellanousTag;
|
||||
@ -1,57 +1,6 @@
|
||||
import React from "react";
|
||||
|
||||
export enum TagType {
|
||||
Roleplay = "Roleplay",
|
||||
Llama = "Llama",
|
||||
Story = "Story",
|
||||
Casual = "Casual",
|
||||
Professional = "Professional",
|
||||
CodeLlama = "CodeLlama",
|
||||
Coding = "Coding",
|
||||
|
||||
// Positive
|
||||
Recommended = "Recommended",
|
||||
Compatible = "Compatible",
|
||||
|
||||
// Neutral
|
||||
SlowOnDevice = "This model will be slow on your device",
|
||||
|
||||
// Negative
|
||||
InsufficientRam = "Insufficient RAM",
|
||||
Incompatible = "Incompatible with your device",
|
||||
TooLarge = "This model is too large for your device",
|
||||
|
||||
// Performance
|
||||
Medium = "Medium",
|
||||
BalancedQuality = "Balanced Quality",
|
||||
}
|
||||
|
||||
const tagStyleMapper: Record<TagType, string> = {
|
||||
[TagType.Roleplay]: "bg-red-100 text-red-800",
|
||||
[TagType.Llama]: "bg-green-100 text-green-800",
|
||||
[TagType.Story]: "bg-blue-100 text-blue-800",
|
||||
[TagType.Casual]: "bg-yellow-100 text-yellow-800",
|
||||
[TagType.Professional]: "text-indigo-800 bg-indigo-100",
|
||||
[TagType.CodeLlama]: "bg-pink-100 text-pink-800",
|
||||
[TagType.Coding]: "text-purple-800 bg-purple-100",
|
||||
|
||||
[TagType.Recommended]:
|
||||
"text-green-700 ring-1 ring-inset ring-green-600/20 bg-green-50",
|
||||
[TagType.Compatible]:
|
||||
"bg-red-50 ext-red-700 ring-1 ring-inset ring-red-600/10",
|
||||
|
||||
[TagType.SlowOnDevice]:
|
||||
"bg-yellow-50 text-yellow-800 ring-1 ring-inset ring-yellow-600/20",
|
||||
|
||||
[TagType.Incompatible]:
|
||||
"bg-red-50 ext-red-700 ring-1 ring-inset ring-red-600/10",
|
||||
[TagType.InsufficientRam]:
|
||||
"bg-red-50 ext-red-700 ring-1 ring-inset ring-red-600/10",
|
||||
[TagType.TooLarge]: "bg-red-50 ext-red-700 ring-1 ring-inset ring-red-600/10",
|
||||
|
||||
[TagType.Medium]: "bg-yellow-100 text-yellow-800",
|
||||
[TagType.BalancedQuality]: "bg-yellow-100 text-yellow-800",
|
||||
};
|
||||
import { TagType } from "./TagType";
|
||||
import { tagStyleMapper } from "./TagStyleMapper";
|
||||
|
||||
type Props = {
|
||||
title: string;
|
||||
@ -66,10 +15,11 @@ const SimpleTag: React.FC<Props> = ({
|
||||
title,
|
||||
type,
|
||||
}) => {
|
||||
if (!title || title.length === 0) return null;
|
||||
if (!clickable) {
|
||||
return (
|
||||
<div
|
||||
className={`px-2.5 py-0.5 rounded text-xs font-medium ${tagStyleMapper[type]}`}
|
||||
className={`px-2.5 py-0.5 rounded text-xs font-medium items-center line-clamp-1 max-w-[40%] ${tagStyleMapper[type]}`}
|
||||
>
|
||||
{title}
|
||||
</div>
|
||||
@ -79,7 +29,7 @@ const SimpleTag: React.FC<Props> = ({
|
||||
return (
|
||||
<button
|
||||
onClick={onClick}
|
||||
className={`px-2.5 py-0.5 rounded text-xs font-medium ${tagStyleMapper[type]}`}
|
||||
className={`px-2.5 py-0.5 rounded text-xs font-medium items-center line-clamp-1 max-w-[40%] ${tagStyleMapper[type]}`}
|
||||
>
|
||||
{title} x
|
||||
</button>
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
import React from "react";
|
||||
import { displayDate } from "@/_utils/datetime";
|
||||
import { TextCode } from "../TextCode";
|
||||
import { getMessageCode } from "@/_utils/message";
|
||||
import Image from "next/image";
|
||||
import { MessageSenderType } from "@/_models/ChatMessage";
|
||||
import LoadingIndicator from "../LoadingIndicator";
|
||||
import { Marked } from "marked";
|
||||
import { markedHighlight } from "marked-highlight";
|
||||
import hljs from "highlight.js";
|
||||
|
||||
type Props = {
|
||||
avatarUrl: string;
|
||||
@ -13,6 +15,27 @@ type Props = {
|
||||
text?: string;
|
||||
};
|
||||
|
||||
const marked = new Marked(
|
||||
markedHighlight({
|
||||
langPrefix: "hljs",
|
||||
highlight(code, lang) {
|
||||
if (lang === undefined || lang === "") {
|
||||
return hljs.highlightAuto(code).value;
|
||||
}
|
||||
return hljs.highlight(code, { language: lang }).value;
|
||||
},
|
||||
}),
|
||||
{
|
||||
renderer: {
|
||||
code(code, lang, escaped) {
|
||||
return `<pre class="hljs"><code class="language-${escape(
|
||||
lang ?? ""
|
||||
)}">${escaped ? code : escape(code)}</code></pre>`;
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const SimpleTextMessage: React.FC<Props> = ({
|
||||
senderName,
|
||||
createdAt,
|
||||
@ -23,9 +46,11 @@ const SimpleTextMessage: React.FC<Props> = ({
|
||||
const backgroundColor =
|
||||
senderType === MessageSenderType.User ? "" : "bg-gray-100";
|
||||
|
||||
const parsedText = marked.parse(text);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`flex items-start gap-2 px-[148px] ${backgroundColor} py-5`}
|
||||
className={`flex items-start gap-2 px-12 md:px-32 2xl:px-64 ${backgroundColor} py-5`}
|
||||
>
|
||||
<Image
|
||||
className="rounded-full"
|
||||
@ -34,7 +59,7 @@ const SimpleTextMessage: React.FC<Props> = ({
|
||||
height={32}
|
||||
alt=""
|
||||
/>
|
||||
<div className="flex flex-col gap-1">
|
||||
<div className="flex flex-col gap-1 w-full">
|
||||
<div className="flex gap-1 justify-start items-baseline">
|
||||
<div className="text-[#1B1B1B] text-sm font-extrabold leading-[15.2px] dark:text-[#d1d5db]">
|
||||
{senderName}
|
||||
@ -43,17 +68,13 @@ const SimpleTextMessage: React.FC<Props> = ({
|
||||
{displayDate(createdAt)}
|
||||
</div>
|
||||
</div>
|
||||
{text.includes("```") ? (
|
||||
getMessageCode(text).map((item, i) => (
|
||||
<div className="flex gap-1 flex-col" key={i}>
|
||||
<p className="leading-[20px] whitespace-break-spaces text-sm font-normal dark:text-[#d1d5db]">
|
||||
{item.text}
|
||||
</p>
|
||||
{item.code.trim().length > 0 && <TextCode text={item.code} />}
|
||||
</div>
|
||||
))
|
||||
{text === "" ? (
|
||||
<LoadingIndicator />
|
||||
) : (
|
||||
<span className="text-sm leading-loose font-normal">{text}</span>
|
||||
<span
|
||||
className="text-sm leading-loose font-normal"
|
||||
dangerouslySetInnerHTML={{ __html: parsedText }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,66 +0,0 @@
|
||||
import React from "react";
|
||||
import { displayDate } from "@/_utils/datetime";
|
||||
import { TextCode } from "../TextCode";
|
||||
import { getMessageCode } from "@/_utils/message";
|
||||
import Image from "next/image";
|
||||
import { useAtomValue } from "jotai";
|
||||
import { currentStreamingMessageAtom } from "@/_helpers/atoms/ChatMessage.atom";
|
||||
|
||||
type Props = {
|
||||
id: string;
|
||||
avatarUrl?: string;
|
||||
senderName: string;
|
||||
createdAt: number;
|
||||
text?: string;
|
||||
};
|
||||
|
||||
const StreamTextMessage: React.FC<Props> = ({
|
||||
id,
|
||||
senderName,
|
||||
createdAt,
|
||||
avatarUrl = "",
|
||||
text = "",
|
||||
}) => {
|
||||
const message = useAtomValue(currentStreamingMessageAtom);
|
||||
|
||||
return message?.text && message?.text?.length > 0 ? (
|
||||
<div className="flex items-start gap-2 ml-3">
|
||||
<Image
|
||||
className="rounded-full"
|
||||
src={avatarUrl}
|
||||
width={32}
|
||||
height={32}
|
||||
alt=""
|
||||
/>
|
||||
<div className="flex flex-col gap-1 w-full">
|
||||
<div className="flex gap-1 justify-start items-baseline">
|
||||
<div className="text-[#1B1B1B] text-sm font-extrabold leading-[15.2px] dark:text-[#d1d5db]">
|
||||
{senderName}
|
||||
</div>
|
||||
<div className="text-xs leading-[13.2px] font-medium text-gray-400">
|
||||
{displayDate(createdAt)}
|
||||
</div>
|
||||
</div>
|
||||
{message.text.includes("```") ? (
|
||||
getMessageCode(message.text).map((item, i) => (
|
||||
<div className="flex gap-1 flex-col" key={i}>
|
||||
<p className="leading-[20px] whitespace-break-spaces text-sm font-normal dark:text-[#d1d5db]">
|
||||
{item.text}
|
||||
</p>
|
||||
{item.code.trim().length > 0 && <TextCode text={item.code} />}
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<p
|
||||
className="leading-[20px] whitespace-break-spaces text-sm font-normal dark:text-[#d1d5db]"
|
||||
dangerouslySetInnerHTML={{ __html: message.text }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<></>
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(StreamTextMessage);
|
||||
@ -1,34 +0,0 @@
|
||||
"use client";
|
||||
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||
import { atomOneDark } from "react-syntax-highlighter/dist/esm/styles/hljs";
|
||||
import Image from "next/image";
|
||||
|
||||
type Props = {
|
||||
text: string;
|
||||
};
|
||||
|
||||
export const TextCode: React.FC<Props> = ({ text }) => (
|
||||
<div className="w-full rounded-lg overflow-hidden bg-[#1F2A37] mr-3">
|
||||
<div className="text-gray-200 bg-gray-800 flex items-center justify-between px-4 py-2 text-xs capitalize">
|
||||
<button onClick={() => navigator.clipboard.writeText(text)}>
|
||||
<Image
|
||||
src={"icons/unicorn_clipboard-alt.svg"}
|
||||
width={24}
|
||||
height={24}
|
||||
alt=""
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
{/*
|
||||
// @ts-ignore */}
|
||||
<SyntaxHighlighter
|
||||
className="w-full overflow-x-hidden resize-none"
|
||||
language="jsx"
|
||||
style={atomOneDark}
|
||||
customStyle={{ padding: "12px", background: "transparent" }}
|
||||
wrapLongLines={true}
|
||||
>
|
||||
{text}
|
||||
</SyntaxHighlighter>
|
||||
</div>
|
||||
);
|
||||