Merge branch 'dev' into release/v0.6.6
This commit is contained in:
commit
2a0597ff01
24
.devcontainer/buildAppImage.sh
Normal file
24
.devcontainer/buildAppImage.sh
Normal file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
make clean
|
||||
|
||||
# To reproduce https://github.com/menloresearch/jan/pull/5463
|
||||
TAURI_TOOLKIT_PATH="${XDG_CACHE_HOME:-$HOME/.cache}/tauri"
|
||||
mkdir -p "$TAURI_TOOLKIT_PATH"
|
||||
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20250213-2/linuxdeploy-x86_64.AppImage -O "$TAURI_TOOLKIT_PATH/linuxdeploy-x86_64.AppImage"
|
||||
chmod +x "$TAURI_TOOLKIT_PATH/linuxdeploy-x86_64.AppImage"
|
||||
|
||||
jq '.bundle.resources = ["resources/pre-install/**/*"] | .bundle.externalBin = ["binaries/cortex-server", "resources/bin/uv"]' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
||||
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
||||
|
||||
make build-tauri
|
||||
|
||||
cp ./src-tauri/resources/bin/bun ./src-tauri/target/release/bundle/appimage/Jan.AppDir/usr/bin/bun
|
||||
mkdir -p ./src-tauri/target/release/bundle/appimage/Jan.AppDir/usr/lib/Jan/binaries/engines
|
||||
cp -f ./src-tauri/binaries/deps/*.so* ./src-tauri/target/release/bundle/appimage/Jan.AppDir/usr/lib/Jan/binaries/
|
||||
cp -f ./src-tauri/binaries/*.so* ./src-tauri/target/release/bundle/appimage/Jan.AppDir/usr/lib/Jan/binaries/
|
||||
cp -rf ./src-tauri/binaries/engines ./src-tauri/target/release/bundle/appimage/Jan.AppDir/usr/lib/Jan/binaries/
|
||||
APP_IMAGE=./src-tauri/target/release/bundle/appimage/$(ls ./src-tauri/target/release/bundle/appimage/ | grep AppImage | head -1)
|
||||
echo $APP_IMAGE
|
||||
rm -f $APP_IMAGE
|
||||
/opt/bin/appimagetool ./src-tauri/target/release/bundle/appimage/Jan.AppDir $APP_IMAGE
|
||||
@ -1,4 +1,20 @@
|
||||
{
|
||||
"name": "jan",
|
||||
"image": "node:20"
|
||||
"name": "Jan",
|
||||
"image": "mcr.microsoft.com/devcontainers/base:jammy",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"version": "20"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/rust:1": {},
|
||||
"ghcr.io/devcontainers-extra/features/corepack:1": {}
|
||||
},
|
||||
|
||||
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",
|
||||
|
||||
// appimagekit requires fuse to package appimage, to use fuse in the container you need to enable it on the host
|
||||
"runArgs": [
|
||||
"--device", "/dev/fuse",
|
||||
"--cap-add=SYS_ADMIN",
|
||||
"--security-opt", "apparmor:unconfined"
|
||||
]
|
||||
}
|
||||
|
||||
20
.devcontainer/postCreateCommand.sh
Executable file
20
.devcontainer/postCreateCommand.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# install tauri prerequisites + xdg-utils for xdg-open + libfuse2 for using appimagekit
|
||||
|
||||
sudo apt update
|
||||
sudo apt install -yqq libwebkit2gtk-4.1-dev \
|
||||
build-essential \
|
||||
curl \
|
||||
wget \
|
||||
file \
|
||||
libxdo-dev \
|
||||
libssl-dev \
|
||||
libayatana-appindicator3-dev \
|
||||
librsvg2-dev \
|
||||
xdg-utils \
|
||||
libfuse2
|
||||
|
||||
sudo mkdir -p /opt/bin
|
||||
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /opt/bin/appimagetool
|
||||
sudo chmod +x /opt/bin/appimagetool
|
||||
24
.github/ISSUE_TEMPLATE/1-bug-report.md
vendored
Normal file
24
.github/ISSUE_TEMPLATE/1-bug-report.md
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
name: 🐛 Bug Report
|
||||
about: If something isn't working as expected 🤔
|
||||
title: 'bug: '
|
||||
type: Bug
|
||||
---
|
||||
|
||||
**Version:** e.g. 0.5.x-xxx
|
||||
|
||||
## Describe the Bug
|
||||
<!-- A clear & concise description of the bug -->
|
||||
|
||||
|
||||
## Steps to Reproduce
|
||||
1.
|
||||
|
||||
## Screenshots / Logs
|
||||
<!-- You can find logs in: Setting -> General -> Data Folder -> App Logs -->
|
||||
|
||||
|
||||
## Operating System
|
||||
- [ ] MacOS
|
||||
- [ ] Windows
|
||||
- [ ] Linux
|
||||
11
.github/ISSUE_TEMPLATE/2-feature-request.md
vendored
Normal file
11
.github/ISSUE_TEMPLATE/2-feature-request.md
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
name: 🚀 Feature Request
|
||||
about: Suggest an idea for this project 😻!
|
||||
title: 'idea: '
|
||||
---
|
||||
|
||||
## Problem Statement
|
||||
<!-- Describe the problem you're facing -->
|
||||
|
||||
## Feature Idea
|
||||
<!-- Describe what you want instead. Examples are welcome! -->
|
||||
12
.github/ISSUE_TEMPLATE/3-epic.md
vendored
Normal file
12
.github/ISSUE_TEMPLATE/3-epic.md
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
name: 🌟 Epic
|
||||
about: Major building block that advances Jan's goals
|
||||
title: 'epic: '
|
||||
type: Epic
|
||||
---
|
||||
|
||||
## Goal
|
||||
|
||||
## Tasklist
|
||||
|
||||
## Out of scope
|
||||
13
.github/ISSUE_TEMPLATE/4-goal.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/4-goal.md
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
name: 🎯 Goal
|
||||
about: External communication of Jan's roadmap and objectives
|
||||
title: 'goal: '
|
||||
type: Goal
|
||||
---
|
||||
|
||||
## Goal
|
||||
|
||||
## Tasklist
|
||||
|
||||
## Out of scope
|
||||
|
||||
43
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
43
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -1,43 +0,0 @@
|
||||
name: "\U0001F41B Bug Report"
|
||||
description: "If something isn't working as expected \U0001F914"
|
||||
labels: [ "type: bug" ]
|
||||
title: 'bug: [DESCRIPTION]'
|
||||
|
||||
body:
|
||||
- type: input
|
||||
validations:
|
||||
required: true
|
||||
attributes:
|
||||
label: "Jan version"
|
||||
description: "**Tip:** The version is in the app's bottom right corner"
|
||||
placeholder: "e.g. 0.5.x-xxx"
|
||||
|
||||
- type: textarea
|
||||
validations:
|
||||
required: true
|
||||
attributes:
|
||||
label: "Describe the Bug"
|
||||
description: "A clear & concise description of the bug"
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Steps to Reproduce"
|
||||
description: |
|
||||
Please list out steps to reproduce the issue
|
||||
placeholder: |
|
||||
1. Go to '...'
|
||||
2. Click on '...'
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Screenshots / Logs"
|
||||
description: |
|
||||
You can find logs in: ~/jan/logs/app.logs
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: "What is your OS?"
|
||||
options:
|
||||
- label: MacOS
|
||||
- label: Windows
|
||||
- label: Linux
|
||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,7 +1,5 @@
|
||||
## To encourage contributors to use issue templates, we don't allow blank issues
|
||||
blank_issues_enabled: true
|
||||
|
||||
contact_links:
|
||||
- name: "\1F4AC Jan Discussions"
|
||||
url: "https://github.com/orgs/menloresearch/discussions/categories/q-a"
|
||||
about: "Get help, discuss features & roadmap, and share your projects"
|
||||
- name: Jan Discussions
|
||||
url: https://github.com/orgs/menloresearch/discussions/categories/q-a
|
||||
about: Get help, discuss features & roadmap, and share your projects
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
20
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@ -1,20 +0,0 @@
|
||||
name: "\U0001F680 Feature Request"
|
||||
description: "Suggest an idea for this project \U0001F63B!"
|
||||
title: 'idea: [DESCRIPTION]'
|
||||
labels: 'type: feature request'
|
||||
body:
|
||||
- type: textarea
|
||||
validations:
|
||||
required: true
|
||||
attributes:
|
||||
label: "Problem Statement"
|
||||
description: "Describe the problem you're facing"
|
||||
placeholder: |
|
||||
I'm always frustrated when ...
|
||||
|
||||
- type: textarea
|
||||
validations:
|
||||
required: true
|
||||
attributes:
|
||||
label: "Feature Idea"
|
||||
description: "Describe what you want instead. Examples are welcome!"
|
||||
21
.github/ISSUE_TEMPLATE/model_request.yml
vendored
21
.github/ISSUE_TEMPLATE/model_request.yml
vendored
@ -1,21 +0,0 @@
|
||||
name: "\U0001F929 Model Request"
|
||||
description: "Request a new model to be compiled"
|
||||
title: 'feat: [DESCRIPTION]'
|
||||
labels: 'type: model request'
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "**Tip:** Download any HuggingFace model in app ([see guides](https://jan.ai/docs/models/manage-models#add-models)). Use this form for unsupported models only."
|
||||
- type: textarea
|
||||
validations:
|
||||
required: true
|
||||
attributes:
|
||||
label: "Model Requests"
|
||||
description: "If applicable, include the source URL, licenses, and any other relevant information"
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: "Which formats?"
|
||||
options:
|
||||
- label: GGUF (llama.cpp)
|
||||
- label: TensorRT (TensorRT-LLM)
|
||||
- label: ONNX (Onnx Runtime)
|
||||
35
.github/ISSUE_TEMPLATE/roadmap.md
vendored
35
.github/ISSUE_TEMPLATE/roadmap.md
vendored
@ -1,35 +0,0 @@
|
||||
---
|
||||
name: Roadmap
|
||||
about: Plan Roadmap items with subtasks
|
||||
title: 'roadmap: '
|
||||
labels: 'type: planning'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Goal
|
||||
|
||||
## Tasklist
|
||||
|
||||
### Frontend
|
||||
- [ ] link to janhq/jan epics
|
||||
|
||||
**Bugs**
|
||||
- [ ] link to bugs
|
||||
|
||||
### Backend
|
||||
- [ ] link to janhq/cortex.cpp epics
|
||||
|
||||
**Bugs**
|
||||
- [ ] link to bug issues
|
||||
|
||||
### Infra
|
||||
- [ ] link to infra issues
|
||||
|
||||
### Administrative / Management
|
||||
- [ ] link to infra issues
|
||||
|
||||
### Marketing
|
||||
|
||||
-------
|
||||
## Resources
|
||||
16
.github/workflows/issues.yaml
vendored
Normal file
16
.github/workflows/issues.yaml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: Adds all issues to project board
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
|
||||
jobs:
|
||||
add-to-project:
|
||||
name: Add issue to project
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/add-to-project@v1.0.2
|
||||
with:
|
||||
project-url: https://github.com/orgs/${{ vars.ORG_NAME }}/projects/${{ vars.JAN_PROJECT_NUMBER }}
|
||||
github-token: ${{ secrets.AUTO_ADD_TICKET_PAT }}
|
||||
@ -154,6 +154,10 @@ jobs:
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install tauri-driver dependencies
|
||||
run: |
|
||||
cargo install tauri-driver --locked
|
||||
|
||||
# Clean cache, continue on error
|
||||
- name: 'Cleanup cache'
|
||||
shell: powershell
|
||||
@ -192,11 +196,25 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/cache@v4 # v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Installing node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install tauri-driver dependencies
|
||||
run: |
|
||||
cargo install tauri-driver --locked
|
||||
|
||||
# Clean cache, continue on error
|
||||
- name: 'Cleanup cache'
|
||||
shell: powershell
|
||||
@ -221,6 +239,20 @@ jobs:
|
||||
# run: |
|
||||
# make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
||||
|
||||
- name: Install Prerequisites
|
||||
shell: 'powershell'
|
||||
# https://github.com/actions/runner-images/issues/9538
|
||||
# https://github.com/microsoft/playwright/pull/30009/files
|
||||
# https://github.com/tauri-apps/wry/issues/1268
|
||||
# Evergreen Bootstrapper
|
||||
# The Bootstrapper is a tiny installer that downloads
|
||||
# the Evergreen Runtime matching device architecture
|
||||
# and installs it locally.
|
||||
# https://developer.microsoft.com/en-us/microsoft-edge/webview2/consumer/?form=MA13LH
|
||||
run: |
|
||||
Invoke-WebRequest -Uri 'https://go.microsoft.com/fwlink/p/?LinkId=2124703' -OutFile 'setup.exe'
|
||||
Start-Process -FilePath setup.exe -Verb RunAs -Wait
|
||||
|
||||
- name: Linter and test
|
||||
shell: powershell
|
||||
run: |
|
||||
@ -240,6 +272,10 @@ jobs:
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install tauri-driver dependencies
|
||||
run: |
|
||||
cargo install tauri-driver --locked
|
||||
|
||||
# Clean cache, continue on error
|
||||
- name: 'Cleanup cache'
|
||||
shell: powershell
|
||||
@ -272,6 +308,15 @@ jobs:
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Tauri dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk-3-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev librsvg2-dev libfuse2 webkit2gtk-driver
|
||||
|
||||
- name: Install tauri-driver dependencies
|
||||
run: |
|
||||
cargo install tauri-driver --locked
|
||||
|
||||
- name: 'Cleanup cache'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
@ -368,6 +413,15 @@ jobs:
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Tauri dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk-3-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev librsvg2-dev libfuse2 webkit2gtk-driver
|
||||
|
||||
- name: Install tauri-driver dependencies
|
||||
run: |
|
||||
cargo install tauri-driver --locked
|
||||
|
||||
- name: 'Cleanup cache'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
|
||||
1
.github/workflows/publish-npm-core.yml
vendored
1
.github/workflows/publish-npm-core.yml
vendored
@ -6,7 +6,6 @@ on:
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
build-and-publish-plugins:
|
||||
environment: production
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@ -43,7 +43,6 @@ jobs:
|
||||
build-linux-x64:
|
||||
if: inputs.public_provider == 'github' || inputs.public_provider == 'none'
|
||||
runs-on: ubuntu-latest
|
||||
environment: production
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
@ -76,7 +75,6 @@ jobs:
|
||||
cp electron/icons_dev/jan-nightly-tray@2x.png electron/icons/icon-tray@2x.png
|
||||
cp electron/icons_dev/jan-nightly-tray.png electron/icons/icon-tray.png
|
||||
|
||||
|
||||
- name: Installing node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
@ -131,7 +129,7 @@ jobs:
|
||||
env:
|
||||
VERSION_TAG: ${{ inputs.new_version }}
|
||||
|
||||
- name: Build and publish app to aws s3 r2 or github artifactory
|
||||
- name: Build and publish app to aws s3 r2 or github artifactory
|
||||
if: inputs.public_provider != 'github'
|
||||
run: |
|
||||
# check public_provider is true or not
|
||||
@ -185,4 +183,4 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: jan-electron-linux-amd64-${{ inputs.new_version }}-AppImage
|
||||
path: ./electron/dist/*.AppImage
|
||||
path: ./electron/dist/*.AppImage
|
||||
|
||||
@ -53,7 +53,6 @@ jobs:
|
||||
build-macos:
|
||||
if: inputs.public_provider == 'github' || inputs.public_provider == 'none'
|
||||
runs-on: macos-latest
|
||||
environment: production
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
@ -61,7 +60,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ inputs.ref }}
|
||||
|
||||
|
||||
- name: Replace Icons for Beta Build
|
||||
if: inputs.beta == true && inputs.nightly != true
|
||||
shell: bash
|
||||
@ -161,7 +160,7 @@ jobs:
|
||||
p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
|
||||
p12-password: ${{ secrets.CODE_SIGN_P12_PASSWORD }}
|
||||
|
||||
- name: Build and publish app to aws s3 r2 or github artifactory
|
||||
- name: Build and publish app to aws s3 r2 or github artifactory
|
||||
if: inputs.public_provider != 'github'
|
||||
run: |
|
||||
# check public_provider is true or not
|
||||
@ -231,4 +230,4 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: jan-electron-mac-universal-${{ inputs.new_version }}
|
||||
path: ./electron/dist/*.dmg
|
||||
path: ./electron/dist/*.dmg
|
||||
|
||||
@ -9,7 +9,6 @@ on:
|
||||
jobs:
|
||||
get-update-version:
|
||||
runs-on: ubuntu-latest
|
||||
environment: production
|
||||
outputs:
|
||||
new_version: ${{ steps.version_update.outputs.new_version }}
|
||||
steps:
|
||||
|
||||
@ -26,7 +26,6 @@ on:
|
||||
|
||||
jobs:
|
||||
noti-discord-and-update-url-readme:
|
||||
environment: production
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
@ -55,7 +55,6 @@ jobs:
|
||||
DEB_SIG: ${{ steps.packageinfo.outputs.DEB_SIG }}
|
||||
APPIMAGE_SIG: ${{ steps.packageinfo.outputs.APPIMAGE_SIG }}
|
||||
APPIMAGE_FILE_NAME: ${{ steps.packageinfo.outputs.APPIMAGE_FILE_NAME }}
|
||||
environment: production
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
@ -96,7 +95,7 @@ jobs:
|
||||
run: |
|
||||
cargo install ctoml
|
||||
|
||||
- name: Install Tauri dependecies
|
||||
- name: Install Tauri dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk-3-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev librsvg2-dev libfuse2
|
||||
|
||||
@ -63,7 +63,6 @@ jobs:
|
||||
outputs:
|
||||
MAC_UNIVERSAL_SIG: ${{ steps.metadata.outputs.MAC_UNIVERSAL_SIG }}
|
||||
TAR_NAME: ${{ steps.metadata.outputs.TAR_NAME }}
|
||||
environment: production
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
||||
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -1,4 +1,7 @@
|
||||
{
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
"editor.formatOnSave": true,
|
||||
"[rust]": {
|
||||
"editor.defaultFormatter": "rust-lang.rust-analyzer"
|
||||
}
|
||||
}
|
||||
|
||||
11
Makefile
11
Makefile
@ -33,23 +33,14 @@ dev: install-and-build
|
||||
yarn copy:lib
|
||||
yarn dev
|
||||
|
||||
# Deprecated soon
|
||||
dev-tauri: install-and-build
|
||||
yarn install:cortex
|
||||
yarn download:bin
|
||||
yarn copy:lib
|
||||
yarn dev:tauri
|
||||
|
||||
# Linting
|
||||
lint: install-and-build
|
||||
yarn lint
|
||||
|
||||
# Testing
|
||||
test: lint
|
||||
# yarn build:test
|
||||
# yarn test:coverage
|
||||
# Need e2e setup for tauri backend
|
||||
yarn test
|
||||
yarn test:e2e
|
||||
|
||||
# Builds and publishes the app
|
||||
build-and-publish: install-and-build
|
||||
|
||||
@ -23,24 +23,24 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@npmcli/arborist": "^7.1.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^22.10.0",
|
||||
"@types/pacote": "^11.1.7",
|
||||
"@types/request": "^2.48.12",
|
||||
"electron": "33.2.1",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-plugin-jest": "^27.9.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest": "^30.0.3",
|
||||
"jest-junit": "^16.0.0",
|
||||
"jest-runner": "^29.7.0",
|
||||
"pacote": "^21.0.0",
|
||||
"request": "^2.88.2",
|
||||
"request-progress": "^3.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"rimraf": "^6.0.1",
|
||||
"rolldown": "1.0.0-beta.1",
|
||||
"ts-jest": "^29.2.5",
|
||||
"tslib": "^2.6.2",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"rxjs": "^7.8.1",
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
"embla-carousel-react": "^8.0.0",
|
||||
"fs": "^0.0.1-security",
|
||||
"gray-matter": "^4.0.3",
|
||||
"lucide-react": "^0.372.0",
|
||||
"lucide-react": "^0.522.0",
|
||||
"next": "^14.1.4",
|
||||
"next-seo": "^6.5.0",
|
||||
"next-sitemap": "^4.2.3",
|
||||
|
||||
BIN
docs/src/pages/docs/_assets/llama.cpp-01-updated.png
Normal file
BIN
docs/src/pages/docs/_assets/llama.cpp-01-updated.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 512 KiB |
@ -56,36 +56,37 @@ cd ~/.config/Jan/data # Default install
|
||||
<Callout type="info">
|
||||
Root directory: `~/jan`
|
||||
</Callout>
|
||||
|
||||
```sh
|
||||
/assistants
|
||||
/jan
|
||||
/assistants/
|
||||
/jan/
|
||||
assistant.json
|
||||
/extensions
|
||||
/engines/
|
||||
/llama.cpp/
|
||||
/extensions/
|
||||
extensions.json
|
||||
/@janhq
|
||||
/extension_A
|
||||
package.json
|
||||
/logs
|
||||
/app.txt
|
||||
/models
|
||||
/model_A
|
||||
model.yaml
|
||||
model_A.yaml
|
||||
/settings
|
||||
settings.json
|
||||
/@janhq
|
||||
/extension_A_Settings
|
||||
settings.json
|
||||
/themes
|
||||
/dark-dimmed
|
||||
/joi-dark
|
||||
/joi-light
|
||||
/night-blue
|
||||
/threads
|
||||
/jan_thread_A
|
||||
messages.jsonl
|
||||
thread.json
|
||||
messages.jsonl
|
||||
/@janhq/
|
||||
/assistant-extension/
|
||||
/conversational-extension/
|
||||
/download-extension/
|
||||
/engine-management-extension/
|
||||
/hardware-management-extension/
|
||||
/inference-cortex-extension/
|
||||
/model-extension/
|
||||
/files/
|
||||
/logs/
|
||||
app.log
|
||||
/models/
|
||||
/huggingface.co/
|
||||
/Model_Provider_A/
|
||||
/Model_A
|
||||
model_A.gguf
|
||||
model_A.yaml
|
||||
/threads/
|
||||
/thread_A/
|
||||
messages.jsonl
|
||||
thread.json
|
||||
|
||||
```
|
||||
|
||||
### `assistants/`
|
||||
@ -93,14 +94,28 @@ Where AI personalities live. The default one (`/assistants/jan/`):
|
||||
|
||||
```json
|
||||
{
|
||||
"avatar": "",
|
||||
"avatar": "👋",
|
||||
"id": "jan",
|
||||
"object": "assistant",
|
||||
"created_at": 1715132389207,
|
||||
"created_at": 1750945742.536,
|
||||
"name": "Jan",
|
||||
"description": "A default assistant that can use all downloaded models",
|
||||
"description": "Jan is a helpful AI assistant that can use tools and help complete tasks for its users.",
|
||||
"model": "*",
|
||||
"instructions": ""
|
||||
"instructions": "You have access to a set of tools to help you answer the user’s question. You can use only one tool per message, and you’ll receive the result of that tool in the user’s next response. To complete a task, use tools step by step—each step should be guided by the outcome of the previous one.\nTool Usage Rules:\n1. Always provide the correct values as arguments when using tools. Do not pass variable names—use actual values instead.\n2. You may perform multiple tool steps to complete a task.\n3. Avoid repeating a tool call with exactly the same parameters to prevent infinite loops.",
|
||||
"tools": [
|
||||
{
|
||||
"type": "retrieval",
|
||||
"enabled": false,
|
||||
"useTimeWeightedRetriever": false,
|
||||
"settings": {
|
||||
"top_k": 2,
|
||||
"chunk_size": 1024,
|
||||
"chunk_overlap": 64,
|
||||
"retrieval_template": "Use the following pieces of context to answer the question at the end.\n----------------\nCONTEXT: {CONTEXT}\n----------------\nQUESTION: {QUESTION}\n----------------\nHelpful Answer:"
|
||||
}
|
||||
}
|
||||
],
|
||||
"file_ids": []
|
||||
}
|
||||
```
|
||||
|
||||
@ -140,88 +155,65 @@ Debugging headquarters (`/logs/app.txt`):
|
||||
The silicon brain collection. Each model has its own `model.json`.
|
||||
|
||||
<Callout type="info">
|
||||
Full parameters: [here](/docs/models/model-parameters)
|
||||
Full parameters: [here](/docs/model-parameters)
|
||||
</Callout>
|
||||
|
||||
### `settings/`
|
||||
Control panel. Extension settings in `/settings/@janhq/`:
|
||||
|
||||
| Parameter | Description |
|
||||
|----------------|----------------------------------------------------|
|
||||
| key | Setting identifier |
|
||||
| title | Display name |
|
||||
| description | Setting explanation |
|
||||
| controllerType | UI component type |
|
||||
| controllerProps| Component properties |
|
||||
| extensionName | Parent extension link |
|
||||
|
||||
GPU settings (`settings.json`):
|
||||
|
||||
| Parameter | Description |
|
||||
|----------------------|--------------------------------------------|
|
||||
| notify | Notification status |
|
||||
| run_mode | Operating mode |
|
||||
| nvidia_driver.exist | NVIDIA driver presence |
|
||||
| nvidia_driver.version| Driver version |
|
||||
| cuda.exist | CUDA availability |
|
||||
| cuda.version | CUDA version |
|
||||
| gpus[0].id | GPU identifier |
|
||||
| gpus[0].vram | GPU memory (MB) |
|
||||
| gpus[0].name | GPU model |
|
||||
| gpus[0].arch | GPU architecture |
|
||||
| gpu_highest_vram | Most capable GPU |
|
||||
| gpus_in_use | Active GPUs |
|
||||
| is_initial | First run flag |
|
||||
| vulkan | Vulkan support |
|
||||
|
||||
### `themes/`
|
||||
Visual wardrobe. Each theme's `theme.json`:
|
||||
|
||||
| Parameter | Description |
|
||||
|------------------|-------------------------------------------|
|
||||
| id | Theme identifier |
|
||||
| displayName | UI name |
|
||||
| reduceTransparent| Transparency control |
|
||||
| nativeTheme | OS theme sync |
|
||||
| variables | Component settings |
|
||||
|
||||
### `threads/`
|
||||
Chat archive. Each thread (`/threads/jan_unixstamp/`) contains:
|
||||
|
||||
- `messages.jsonl`:
|
||||
```json
|
||||
{
|
||||
"id":"01J6Y6FH8PFTHQB5PNJTHEN27C",
|
||||
"thread_id":"jan_1725437954",
|
||||
"type":"Thread",
|
||||
"role":"assistant",
|
||||
"content":
|
||||
[
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"value": "Hello! Is there something I can help you with or would you like to chat?",
|
||||
"annotations": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"status": "ready",
|
||||
"created": 1725442802966,
|
||||
"updated": 1725442802966,
|
||||
"object": "thread.message"
|
||||
}
|
||||
{
|
||||
"completed_at": 0,
|
||||
"content": [
|
||||
{
|
||||
"text": {
|
||||
"annotations": [],
|
||||
"value": "Hello! I can help you with various tasks. I can search for information on the internet, including news, videos, images, shopping, and more. I can also scrape webpages to extract specific information. Let me know what you need!"
|
||||
},
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"created_at": 1751012639307,
|
||||
"id": "01JYR7S0JB5ZBGMJV52KWMW5VW",
|
||||
"metadata": {
|
||||
"assistant": {
|
||||
"avatar": "👋",
|
||||
"id": "jan",
|
||||
"instructions": "You have access to a set of tools to help you answer the user's question. You can use only one tool per message, and you'll receive the result of that tool in the user's next response. To complete a task, use tools step by step—each step should be guided by the outcome of the previous one.\nTool Usage Rules:\n1. Always provide the correct values as arguments when using tools. Do not pass variable names—use actual values instead.\n2. You may perform multiple tool steps to complete a task.\n3. Avoid repeating a tool call with exactly the same parameters to prevent infinite loops.",
|
||||
"name": "Jan",
|
||||
"parameters": ""
|
||||
},
|
||||
"tokenSpeed": {
|
||||
"lastTimestamp": 1751012637097,
|
||||
"message": "01JYR7S0GW5M9PSHMRE7T8VQJM",
|
||||
"tokenCount": 49,
|
||||
"tokenSpeed": 22.653721682847895
|
||||
}
|
||||
},
|
||||
"object": "thread.message",
|
||||
"role": "assistant",
|
||||
"status": "ready",
|
||||
"thread_id": "8f2c9922-db49-4d1e-8620-279c05baf2d0",
|
||||
"type": "text"
|
||||
}
|
||||
```
|
||||
|
||||
- `thread.json`:
|
||||
|
||||
| Parameter | Description |
|
||||
|------------|------------------------------------------------|
|
||||
| assistants | Assistant configuration clone |
|
||||
| created | Creation timestamp |
|
||||
| id | Thread identifier |
|
||||
| metadata | Additional thread data |
|
||||
| model | Active model settings |
|
||||
| object | OpenAI compatibility marker |
|
||||
| title | Thread name |
|
||||
| assistants | Assistant configuration clone |
|
||||
| model | Active model settings |
|
||||
| metadata | Additional thread data |
|
||||
| updated | Updated timestamp |
|
||||
|
||||
|
||||
|
||||
|
||||
## Delete Jan Data
|
||||
Uninstall guides: [Mac](/docs/desktop/mac#step-2-clean-up-data-optional),
|
||||
|
||||
@ -33,7 +33,7 @@ import { Settings, EllipsisVertical, Plus, FolderOpen, Pencil } from 'lucide-rea
|
||||
Jan uses **llama.cpp** for running local AI models. You can find its settings in **Settings** (<Settings width={16} height={16} style={{display:"inline"}}/>) > **Local Engine** > **llama.cpp**:
|
||||
|
||||
<br/>
|
||||

|
||||

|
||||
<br/>
|
||||
|
||||
These settings are for advanced users, you would want to check these settings when:
|
||||
@ -151,6 +151,7 @@ For detailed hardware compatibility, please visit our guide for [Mac](/docs/desk
|
||||
| **Caching** | - Enable to store recent prompts and responses<br></br>- Improves response time for repeated prompts | Enabled |
|
||||
| **KV Cache Type** | - KV cache implementation type; controls memory usage and precision trade-off<br></br>- Options:<br></br>• f16 (most stable)<br></br>• q8_0 (balanced)<br></br>• q4_0 (lowest memory) | f16 |
|
||||
| **mmap** | - Enables memory-mapped model loading<br></br>- Reduces memory usage<br></br>- Recommended for large models | Enabled |
|
||||
| **Context Shift** | - Automatically shifts the context window when the model is unable to process the entire prompt<br/> - Ensures that the most relevant information is always included <br/> - Recommended for long conversations and multiple tool calls | Disabled |
|
||||
|
||||
|
||||
## Best Practices
|
||||
|
||||
@ -38,8 +38,6 @@ These settings are available in the model settings modal:
|
||||
| **Repeat Last N** | Number of tokens to consider for repeat penalty. |
|
||||
| **Repeat Penalty** | Penalize repeating token sequences. |
|
||||
| **Presence Penalty**| Penalize alpha presence (encourages new topics). |
|
||||
| **Max Tokens** | Maximum length of the model's response. |
|
||||
| **Stop Sequences** | Tokens or phrases that will end the model's response. |
|
||||
| **Frequency Penalty** | Reduces word repetition. |
|
||||
|
||||
<br/>
|
||||
|
||||
@ -36,11 +36,15 @@ Follow this [guide](https://continue.dev/docs/quickstart) to install the Continu
|
||||
|
||||
To set up Continue for use with Jan's Local Server, you must activate the Jan API Server with your chosen model.
|
||||
|
||||
1. Press the `<>` button. Jan will take you to the **Local API Server** section.
|
||||
1. Press the `⚙️ Settings` button.
|
||||
|
||||
2. Setup the server, which includes the **IP Port**, **Cross-Origin-Resource-Sharing (CORS)** and **Verbose Server Logs**.
|
||||
2. Locate `Local API Server`.
|
||||
|
||||
3. Press the **Start Server** button
|
||||
3. Setup the server, which includes the **IP Port**, **Cross-Origin-Resource-Sharing (CORS)** and **Verbose Server Logs**.
|
||||
|
||||
4. Include your user-defined API Key.
|
||||
|
||||
5. Press the **Start Server** button
|
||||
|
||||
### Step 3: Configure Continue to Use Jan's Local Server
|
||||
|
||||
@ -64,30 +68,35 @@ To set up Continue for use with Jan's Local Server, you must activate the Jan AP
|
||||
</Tabs.Tab>
|
||||
</Tabs>
|
||||
|
||||
```json title="~/.continue/config.json"
|
||||
{
|
||||
"models": [
|
||||
{
|
||||
"title": "Jan",
|
||||
"provider": "openai",
|
||||
"model": "mistral-ins-7b-q4",
|
||||
"apiKey": "EMPTY",
|
||||
"apiBase": "http://localhost:1337/v1"
|
||||
}
|
||||
]
|
||||
}
|
||||
```yaml title="~/.continue/config.yaml"
|
||||
name: Local Assistant
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
models:
|
||||
- name: Jan
|
||||
provider: openai
|
||||
model: #MODEL_NAME (e.g. qwen3:0.6b)
|
||||
apiKey: #YOUR_USER_DEFINED_API_KEY_HERE (e.g. hello)
|
||||
apiBase: http://localhost:1337/v1
|
||||
context:
|
||||
- provider: code
|
||||
- provider: docs
|
||||
- provider: diff
|
||||
- provider: terminal
|
||||
- provider: problems
|
||||
- provider: folder
|
||||
- provider: codebase
|
||||
```
|
||||
|
||||
2. Ensure the file has the following configurations:
|
||||
- Ensure `openai` is selected as the `provider`.
|
||||
- Match the `model` with the one enabled in the Jan API Server.
|
||||
- Set `apiBase` to `http://localhost:1337`.
|
||||
- Leave the `apiKey` field to `EMPTY`.
|
||||
- Set `apiBase` to `http://localhost:1337/v1`.
|
||||
|
||||
### Step 4: Ensure the Using Model Is Activated in Jan
|
||||
|
||||
1. Navigate to `Settings` > `My Models`.
|
||||
2. Click the **three dots (⋮)** button.
|
||||
1. Navigate to `Settings` > `Model Providers`.
|
||||
2. Under Llama.cpp, find the model that you would want to use.
|
||||
3. Select the **Start Model** button to activate the model.
|
||||
|
||||
</Steps>
|
||||
|
||||
@ -5503,10 +5503,10 @@ lru-cache@^4.0.1:
|
||||
pseudomap "^1.0.2"
|
||||
yallist "^2.1.2"
|
||||
|
||||
lucide-react@^0.372.0:
|
||||
version "0.372.0"
|
||||
resolved "https://registry.npmjs.org/lucide-react/-/lucide-react-0.372.0.tgz"
|
||||
integrity sha512-0cKdqmilHXWUwWAWnf6CrrjHD8YaqPMtLrmEHXolZusNTr9epULCsiJwIOHk2q1yFxdEwd96D4zShlAj67UJdA==
|
||||
lucide-react@^0.522.0:
|
||||
version "0.522.0"
|
||||
resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.522.0.tgz#c0951dd32936b6a7bcc474a829a251fede0bdfbd"
|
||||
integrity sha512-jnJbw974yZ7rQHHEFKJOlWAefG3ATSCZHANZxIdx8Rk/16siuwjgA4fBULpXEAWx/RlTs3FzmKW/udWUuO0aRw==
|
||||
|
||||
lz-string@^1.5.0:
|
||||
version "1.5.0"
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cpx": "^1.5.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"rimraf": "^6.0.1",
|
||||
"rolldown": "1.0.0-beta.1",
|
||||
"run-script-os": "^1.1.6",
|
||||
"typescript": "^5.3.3"
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cpx": "^1.5.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"rimraf": "^6.0.1",
|
||||
"rolldown": "1.0.0-beta.1",
|
||||
"ts-loader": "^9.5.0",
|
||||
"typescript": "^5.7.2"
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cpx": "^1.5.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"rimraf": "^6.0.1",
|
||||
"rolldown": "1.0.0-beta.1",
|
||||
"run-script-os": "^1.1.6",
|
||||
"typescript": "5.8.3",
|
||||
|
||||
@ -24,13 +24,7 @@ run = [
|
||||
[tasks.install]
|
||||
description = "Install dependencies"
|
||||
depends = ["config-yarn"]
|
||||
run = '''
|
||||
#!/usr/bin/env bash
|
||||
# Skip install on Windows per Makefile logic
|
||||
if [[ "$OSTYPE" != "msys" && "$OSTYPE" != "win32" ]]; then
|
||||
yarn install
|
||||
fi
|
||||
'''
|
||||
run = "yarn install"
|
||||
sources = ['package.json', 'yarn.lock']
|
||||
outputs = ['node_modules']
|
||||
|
||||
|
||||
10
package.json
10
package.json
@ -4,7 +4,8 @@
|
||||
"workspaces": {
|
||||
"packages": [
|
||||
"core",
|
||||
"web-app"
|
||||
"web-app",
|
||||
"tests-e2e-js"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
@ -13,6 +14,11 @@
|
||||
"build": "yarn build:web && yarn build:tauri",
|
||||
"test": "yarn workspace @janhq/web-app test",
|
||||
"test:coverage": "yarn workspace @janhq/web-app test",
|
||||
"test:prepare": "yarn build:icon && yarn copy:lib && yarn copy:assets:tauri && yarn build --no-bundle ",
|
||||
"test:e2e:linux": "yarn test:prepare && xvfb-run yarn workspace tests-e2-js test",
|
||||
"test:e2e:win32": "yarn test:prepare && yarn workspace tests-e2-js test",
|
||||
"test:e2e:darwin": "echo 'E2E tests are not supported on macOS yet due to WebDriver limitations'",
|
||||
"test:e2e": "run-script-os",
|
||||
"dev:web": "yarn workspace @janhq/web-app dev",
|
||||
"dev:tauri": "CLEAN=true yarn build:icon && yarn copy:assets:tauri && tauri dev",
|
||||
"install:cortex:linux:darwin": "cd src-tauri/binaries && ./download.sh",
|
||||
@ -39,7 +45,7 @@
|
||||
"cpx": "^1.5.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"husky": "^9.1.5",
|
||||
"jest": "^29.7.0",
|
||||
"jest": "^30.0.3",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"run-script-os": "^1.1.6",
|
||||
|
||||
@ -19,8 +19,8 @@ tauri-build = { version = "2.0.2", features = [] }
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
log = "0.4"
|
||||
tauri = { version = "2.4.0", features = [ "protocol-asset", "macos-private-api",
|
||||
"test",
|
||||
tauri = { version = "2.5.0", features = [ "protocol-asset", "macos-private-api",
|
||||
"test"
|
||||
] }
|
||||
tauri-plugin-log = "2.0.0-rc"
|
||||
tauri-plugin-shell = "2.2.0"
|
||||
|
||||
@ -277,7 +277,12 @@ pub fn setup_sidecar(app: &App) -> Result<(), String> {
|
||||
]);
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
let resource_dir = app_handle_for_spawn.path().resource_dir().unwrap();
|
||||
let mut resource_dir = app_handle_for_spawn.path().resource_dir().unwrap();
|
||||
// If debug
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
resource_dir = resource_dir.join("binaries");
|
||||
}
|
||||
let normalized_path = resource_dir.to_string_lossy().replace(r"\\?\", "");
|
||||
let normalized_pathbuf = PathBuf::from(normalized_path);
|
||||
cmd = cmd.current_dir(normalized_pathbuf);
|
||||
@ -286,12 +291,12 @@ pub fn setup_sidecar(app: &App) -> Result<(), String> {
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
cmd = cmd.env("LD_LIBRARY_PATH", {
|
||||
let current_app_data_dir = app_handle_for_spawn
|
||||
.path()
|
||||
.resource_dir()
|
||||
.unwrap()
|
||||
.join("binaries");
|
||||
let dest = current_app_data_dir.to_str().unwrap();
|
||||
let mut resource_dir = app_handle_for_spawn.path().resource_dir().unwrap();
|
||||
#[cfg(not(debug_assertions))]
|
||||
{
|
||||
resource_dir = resource_dir.join("binaries");
|
||||
}
|
||||
let dest = resource_dir.to_str().unwrap();
|
||||
let ld_path_env = std::env::var("LD_LIBRARY_PATH").unwrap_or_default();
|
||||
format!("{}{}{}", ld_path_env, ":", dest)
|
||||
});
|
||||
|
||||
@ -33,7 +33,7 @@ ${StrLoc}
|
||||
!define VERSION "jan_version"
|
||||
!define VERSIONWITHBUILD "jan_build"
|
||||
!define HOMEPAGE ""
|
||||
!define INSTALLMODE "currentUser"
|
||||
!define INSTALLMODE "both"
|
||||
!define LICENSE ""
|
||||
!define INSTALLERICON "D:\a\jan\jan\src-tauri\icons\icon.ico"
|
||||
!define SIDEBARIMAGE ""
|
||||
|
||||
1
tests-e2e-js/.gitignore
vendored
Normal file
1
tests-e2e-js/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
dist
|
||||
23
tests-e2e-js/package.json
Normal file
23
tests-e2e-js/package.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "tests-e2-js",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "node --test --test-force-exit --loader ts-node/esm ./src/main.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-e2e/selenium": "0.2.2",
|
||||
"log4js": "^6.9.1",
|
||||
"selenium-webdriver": "^4.22.0",
|
||||
"ts-node": "^10.9.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.9",
|
||||
"@types/selenium-webdriver": "^4.1.28",
|
||||
"tsimp": "^2.0.11",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
}
|
||||
51
tests-e2e-js/src/main.ts
Normal file
51
tests-e2e-js/src/main.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import assert from 'node:assert'
|
||||
import { ChildProcess } from 'node:child_process'
|
||||
import { afterEach, beforeEach, describe, test } from 'node:test'
|
||||
import { By, until, WebDriver } from 'selenium-webdriver'
|
||||
import * as e2e from '@tauri-e2e/selenium'
|
||||
import { default as log4js } from 'log4js'
|
||||
|
||||
let logger = log4js.getLogger()
|
||||
logger.level = 'debug'
|
||||
|
||||
process.env.TAURI_WEBDRIVER_LOGLEVEL = 'debug'
|
||||
process.env.TAURI_WEBDRIVER_BINARY = await e2e.install.PlatformDriver()
|
||||
process.env.TAURI_SELENIUM_BINARY = '../src-tauri/target/release/Jan.exe'
|
||||
process.env.SELENIUM_REMOTE_URL = 'http://127.0.0.1:6655'
|
||||
|
||||
//@ts-ignore fuck you javascript
|
||||
e2e.setLogger(logger)
|
||||
|
||||
describe('Tauri E2E tests', async () => {
|
||||
let driver: WebDriver
|
||||
let webDriver: ChildProcess
|
||||
|
||||
beforeEach(async () => {
|
||||
// Spawn WebDriver process.
|
||||
webDriver = await e2e.launch.spawnWebDriver()
|
||||
// wait 1 second
|
||||
await new Promise((r) => setTimeout(r, 1000))
|
||||
// Create driver session.
|
||||
driver = new e2e.selenium.Builder().build()
|
||||
// Wait for the body element to be present
|
||||
// await driver.wait(until.elementLocated({ css: 'body' }))
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
await e2e.selenium.cleanupSession(driver)
|
||||
e2e.launch.killWebDriver(webDriver)
|
||||
})
|
||||
|
||||
test('Find hub', async () => {
|
||||
const hub = until.elementLocated(By.css('[data-test-id="menu-common:hub"'))
|
||||
// console.log('GG', hub)
|
||||
// @ts-ignore
|
||||
await driver.wait(hub.fn, 120000)
|
||||
|
||||
const menuElement = await driver.findElement({
|
||||
css: '[data-test-id="menu-common:hub"]',
|
||||
})
|
||||
assert(menuElement !== null, 'Hub menu element should be available')
|
||||
await menuElement.isDisplayed()
|
||||
})
|
||||
})
|
||||
21
tests-e2e-js/tsconfig.json
Normal file
21
tests-e2e-js/tsconfig.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true
|
||||
},
|
||||
"include": [
|
||||
"src/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
],
|
||||
}
|
||||
@ -46,7 +46,7 @@
|
||||
"i18next": "^25.0.1",
|
||||
"katex": "^0.16.22",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"lucide-react": "^0.503.0",
|
||||
"lucide-react": "^0.522.0",
|
||||
"motion": "^12.10.5",
|
||||
"next-themes": "^0.4.6",
|
||||
"posthog-js": "^1.246.0",
|
||||
@ -88,7 +88,7 @@
|
||||
"eslint-plugin-react-refresh": "^0.4.19",
|
||||
"globals": "^16.0.0",
|
||||
"tailwind-merge": "^3.2.0",
|
||||
"typescript": "~5.7.2",
|
||||
"typescript": "~5.8.3",
|
||||
"typescript-eslint": "^8.26.1",
|
||||
"vite": "^6.3.0",
|
||||
"vite-plugin-node-polyfills": "^0.23.0",
|
||||
|
||||
@ -365,6 +365,7 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
|
||||
rows={1}
|
||||
maxRows={10}
|
||||
value={prompt}
|
||||
data-test-id={'chat-input'}
|
||||
onChange={(e) => {
|
||||
setPrompt(e.target.value)
|
||||
// Count the number of newlines to estimate rows
|
||||
@ -567,6 +568,7 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
|
||||
variant={!prompt.trim() ? null : 'default'}
|
||||
size="icon"
|
||||
disabled={!prompt.trim()}
|
||||
data-test-id="send-message-button"
|
||||
onClick={() => handleSendMesage(prompt)}
|
||||
>
|
||||
{streamingContent ? (
|
||||
|
||||
@ -452,6 +452,7 @@ const LeftPanel = () => {
|
||||
key={menu.title}
|
||||
to={menu.route}
|
||||
onClick={() => isSmallScreen && setLeftPanel(false)}
|
||||
data-test-id={`menu-${menu.title}`}
|
||||
className={cn(
|
||||
'flex items-center gap-1.5 cursor-pointer hover:bg-left-panel-fg/10 py-1 px-1 rounded',
|
||||
isActive
|
||||
|
||||
@ -259,11 +259,16 @@ function Hub() {
|
||||
</div>
|
||||
)}
|
||||
{isDownloaded ? (
|
||||
<Button size="sm" onClick={() => handleUseModel(modelId)}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => handleUseModel(modelId)}
|
||||
data-test-id={`hub-model-${modelId}`}
|
||||
>
|
||||
{t('hub:use')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
data-test-id={`hub-model-${modelId}`}
|
||||
size="sm"
|
||||
onClick={handleDownload}
|
||||
className={cn(isDownloading && 'hidden')}
|
||||
|
||||
@ -226,7 +226,7 @@ function ThreadDetail() {
|
||||
return (
|
||||
<div
|
||||
key={item.id}
|
||||
data-test-id={`message-${item.id}`}
|
||||
data-test-id={`message-${item.role}-${item.id}`}
|
||||
data-message-author-role={item.role}
|
||||
className="mb-4"
|
||||
>
|
||||
@ -247,7 +247,10 @@ function ThreadDetail() {
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
<StreamingContent threadId={threadId} />
|
||||
<StreamingContent
|
||||
threadId={threadId}
|
||||
data-test-id="thread-content-text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user