Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
This PR is to enable the standalone web deployment with Jan frontend to run with a running cortex.cpp server.
Caution:
This is just an experimental PR
To run this:
yarn dev:web:standalone
localhost:3000
on safari or chrome browser (there is a known issue with Arc, WIP)Changes made
This pull request includes several changes to enhance the functionality and compatibility of the JanHQ application, particularly focusing on handling web and electron environments, improving theme management, and updating extension handling. The most important changes include modifications to the
ExtensionManager
class, the addition of a new theme, and updates to the build and development scripts.Enhancements to Extension Handling:
web/extension/ExtensionManager.ts
: Added logic to handle extensions differently based on the environment (electron or web). This includes usingWebExtensions
for web environments and modifying theactivateExtension
method to simplify the URL handling for extensions. [1] [2] [3] [4]web/extensions.json
: Added a JSON file that lists all available extensions with their metadata, which will be used in web environments.Theme Management Improvements:
web/hooks/useLoadTheme.ts
: Added logic to load a default theme (DefaultTheme
) when the application is running in a web environment. [1] [2]web/theme.json
: Introduced a new theme configuration file to define the "Joi Light" theme, including various UI element styles.Build and Development Script Updates:
package.json
: Added a new scriptdev:web:standalone
for running the web application in standalone mode and updated thebuild:web
script to fix a syntax issue.Code Simplification:
web/hooks/useModels.ts
: Simplified the retrieval of models by replacing.toArray()
withArray.from()
for better readability and consistency. [1] [2] [3]Compatibility Enhancements:
extensions/inference-cortex-extension/src/index.ts
: Added a check to ensure compatibility with environments that do not haveelectronAPI
.web/hooks/useSendChatMessage.ts
: Added logic to handle message requests differently based on the environment (electron or web). [1] [2]