chore: add some ts-ignore to make tauri build works (#5010)

* chore: add some ts-ignore to make build works

* chore: remove tauri build nightly script

* chore: update core package.json

* chore: fix build

* chore: add devtools for tauri beta, nightly

* chore: change transport-sse to transport-sse-server

* chore: comment out dll files

* chore: add ts-ignore

* chore: update nightly CI
This commit is contained in:
vansangpfiev 2025-05-19 14:49:03 +07:00 committed by GitHub
parent 1d4af26b5c
commit 90da49f873
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 41 additions and 218 deletions

View File

@ -123,9 +123,9 @@ jobs:
runs-on: ubuntu-latest
needs: [
set-public-provider,
build-electron-windows-x64,
build-electron-linux-x64,
build-electron-macos,
# build-electron-windows-x64,
# build-electron-linux-x64,
# build-electron-macos,
build-tauri-windows-x64,
build-tauri-linux-x64,
build-tauri-macos
@ -161,9 +161,9 @@ jobs:
noti-discord-pre-release-and-update-url-readme:
needs: [
build-electron-macos,
build-electron-windows-x64,
build-electron-linux-x64,
# build-electron-macos,
# build-electron-windows-x64,
# build-electron-linux-x64,
build-tauri-macos,
build-tauri-windows-x64,
build-tauri-linux-x64,
@ -201,9 +201,9 @@ jobs:
comment-pr-build-url:
needs: [
build-electron-macos,
build-electron-windows-x64,
build-electron-linux-x64,
# build-electron-macos,
# build-electron-windows-x64,
# build-electron-linux-x64,
build-tauri-macos,
build-tauri-windows-x64,
build-tauri-linux-x64,

View File

@ -1,187 +0,0 @@
name: Tauri Builder - Nightly / Manual
on:
schedule:
- cron: '0 20 * * 1,2,3' # At 8 PM UTC on Monday, Tuesday, and Wednesday which is 3 AM UTC+7 Tuesday, Wednesday, and Thursday
workflow_dispatch:
inputs:
public_provider:
type: choice
description: 'Public Provider'
options:
- none
- aws-s3
default: none
pull_request_review:
types: [submitted]
jobs:
set-public-provider:
runs-on: ubuntu-latest
outputs:
public_provider: ${{ steps.set-public-provider.outputs.public_provider }}
ref: ${{ steps.set-public-provider.outputs.ref }}
steps:
- name: Set public provider
id: set-public-provider
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "::set-output name=public_provider::${{ github.event.inputs.public_provider }}"
echo "::set-output name=ref::${{ github.ref }}"
else
if [ "${{ github.event_name }}" == "schedule" ]; then
echo "::set-output name=public_provider::aws-s3"
echo "::set-output name=ref::refs/heads/dev"
elif [ "${{ github.event_name }}" == "push" ]; then
echo "::set-output name=public_provider::aws-s3"
echo "::set-output name=ref::${{ github.ref }}"
elif [ "${{ github.event_name }}" == "pull_request_review" ]; then
echo "::set-output name=public_provider::none"
echo "::set-output name=ref::${{ github.ref }}"
else
echo "::set-output name=public_provider::none"
echo "::set-output name=ref::${{ github.ref }}"
fi
fi
# Job create Update app version based on latest release tag with build number and save to output
get-update-version:
uses: ./.github/workflows/template-get-update-version.yml
build-macos:
uses: ./.github/workflows/template-tauri-build-macos.yml
needs: [get-update-version, set-public-provider]
secrets: inherit
with:
ref: ${{ needs.set-public-provider.outputs.ref }}
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
new_version: ${{ needs.get-update-version.outputs.new_version }}
channel: nightly
cortex_api_port: "39261"
build-windows-x64:
uses: ./.github/workflows/template-tauri-build-windows-x64.yml
secrets: inherit
needs: [get-update-version, set-public-provider]
with:
ref: ${{ needs.set-public-provider.outputs.ref }}
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
new_version: ${{ needs.get-update-version.outputs.new_version }}
channel: nightly
cortex_api_port: "39261"
build-linux-x64:
uses: ./.github/workflows/template-tauri-build-linux-x64.yml
secrets: inherit
needs: [get-update-version, set-public-provider]
with:
ref: ${{ needs.set-public-provider.outputs.ref }}
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
new_version: ${{ needs.get-update-version.outputs.new_version }}
channel: nightly
cortex_api_port: "39261"
sync-temp-to-latest:
needs: [get-update-version, set-public-provider, build-windows-x64, build-linux-x64, build-macos]
runs-on: ubuntu-latest
steps:
- name: Getting the repo
uses: actions/checkout@v3
- name: Install jq
uses: dcarbone/install-jq-action@v2.0.1
- name: create latest.json file
run: |
VERSION=${{ needs.get-update-version.outputs.new_version }}
PUB_DATE=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
LINUX_SIGNATURE="${{ needs.build-linux-x64.outputs.APPIMAGE_SIG }}"
LINUX_URL="https://delta.jan.ai/nightly/${{ needs.build-linux-x64.outputs.APPIMAGE_FILE_NAME }}"
WINDOWS_SIGNATURE="${{ needs.build-windows-x64.outputs.WIN_SIG }}"
WINDOWS_URL="https://delta.jan.ai/nightly/${{ needs.build-windows-x64.outputs.FILE_NAME }}"
DARWIN_SIGNATURE="${{ needs.build-macos.outputs.MAC_UNIVERSAL_SIG }}"
DARWIN_URL="https://delta.jan.ai/nightly/Jan-nightly_${{ needs.get-update-version.outputs.new_version }}.app.tar.gz"
jq --arg version "$VERSION" \
--arg pub_date "$PUB_DATE" \
--arg linux_signature "$LINUX_SIGNATURE" \
--arg linux_url "$LINUX_URL" \
--arg windows_signature "$WINDOWS_SIGNATURE" \
--arg windows_url "$WINDOWS_URL" \
--arg darwin_arm_signature "$DARWIN_SIGNATURE" \
--arg darwin_arm_url "$DARWIN_URL" \
--arg darwin_amd_signature "$DARWIN_SIGNATURE" \
--arg darwin_amd_url "$DARWIN_URL" \
'.version = $version
| .pub_date = $pub_date
| .platforms["linux-x86_64"].signature = $linux_signature
| .platforms["linux-x86_64"].url = $linux_url
| .platforms["windows-x86_64"].signature = $windows_signature
| .platforms["windows-x86_64"].url = $windows_url
| .platforms["darwin-aarch64"].signature = $darwin_arm_signature
| .platforms["darwin-aarch64"].url = $darwin_arm_url
| .platforms["darwin-x86_64"].signature = $darwin_amd_signature
| .platforms["darwin-x86_64"].url = $darwin_amd_url' \
src-tauri/latest.json.template > latest.json
cat latest.json
- name: Sync temp to latest
if: ${{ needs.set-public-provider.outputs.public_provider == 'aws-s3' }}
run: |
aws s3 cp ./latest.json s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/latest.json
aws s3 sync s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/ s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/nightly/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.DELTA_AWS_REGION }}
AWS_EC2_METADATA_DISABLED: "true"
noti-discord-nightly-and-update-url-readme:
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, sync-temp-to-latest]
secrets: inherit
if: github.event_name == 'schedule'
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
with:
ref: refs/heads/dev
build_reason: Nightly
push_to_branch: dev
new_version: ${{ needs.get-update-version.outputs.new_version }}
noti-discord-pre-release-and-update-url-readme:
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, sync-temp-to-latest]
secrets: inherit
if: github.event_name == 'push'
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
with:
ref: refs/heads/dev
build_reason: Pre-release
push_to_branch: dev
new_version: ${{ needs.get-update-version.outputs.new_version }}
noti-discord-manual-and-update-url-readme:
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, sync-temp-to-latest]
secrets: inherit
if: github.event_name == 'workflow_dispatch' && github.event.inputs.public_provider == 'aws-s3'
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
with:
ref: refs/heads/dev
build_reason: Manual
push_to_branch: dev
new_version: ${{ needs.get-update-version.outputs.new_version }}
comment-pr-build-url:
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, sync-temp-to-latest]
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_review'
steps:
- name: Set up GitHub CLI
run: |
curl -sSL https://github.com/cli/cli/releases/download/v2.33.0/gh_2.33.0_linux_amd64.tar.gz | tar xz
sudo cp gh_2.33.0_linux_amd64/bin/gh /usr/local/bin/
- name: Comment build URL on PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_URL=${{ github.event.pull_request.html_url }}
RUN_ID=${{ github.run_id }}
COMMENT="This is the build for this pull request. You can download it from the Artifacts section here: [Build URL](https://github.com/${{ github.repository }}/actions/runs/${RUN_ID})."
gh pr comment $PR_URL --body "$COMMENT"

View File

@ -131,6 +131,7 @@ jobs:
# Update Cargo.toml
ctoml ./src-tauri/Cargo.toml package.name "Jan-${{ inputs.channel }}"
ctoml ./src-tauri/Cargo.toml dependencies.tauri.features[] "devtools"
echo "------------------"
cat ./src-tauri/Cargo.toml

View File

@ -138,6 +138,7 @@ jobs:
# Update Cargo.toml
ctoml ./src-tauri/Cargo.toml package.name "Jan-${{ inputs.channel }}"
ctoml ./src-tauri/Cargo.toml dependencies.tauri.features[] "devtools"
echo "------------------"
cat ./src-tauri/Cargo.toml

View File

@ -150,6 +150,7 @@ jobs:
# Update Cargo.toml
ctoml ./src-tauri/Cargo.toml package.name "Jan-${{ inputs.channel }}"
ctoml ./src-tauri/Cargo.toml dependencies.tauri.features[] "devtools"
echo "------------------"
cat ./src-tauri/Cargo.toml

View File

@ -21,7 +21,7 @@ call %DOWNLOAD_TOOL% %ENGINE_DOWNLOAD_URL%-avx2-x64.tar.gz -e --strip 2 -o./engi
call %DOWNLOAD_TOOL% %ENGINE_DOWNLOAD_URL%-avx512-x64.tar.gz -e --strip 2 -o./engines/llama.cpp/win-avx512-x64/%ENGINE_VERSION%
call %DOWNLOAD_TOOL% %ENGINE_DOWNLOAD_GGML_URL%-vulkan-x64.zip -e --strip 1 -o./engines/llama.cpp/win-vulkan-x64/%ENGINE_VERSION%
call %DOWNLOAD_TOOL% %CUDA_DOWNLOAD_URL%/cudart-llama-bin-win-cu12.0-x64.tar.gz -e --strip 1 -o %BIN_PATH%
@REM call %DOWNLOAD_TOOL% %CUDA_DOWNLOAD_URL%/cudart-llama-bin-win-cu11.7-x64.tar.gz -e --strip 1 -o %BIN_PATH%
call %DOWNLOAD_TOOL% %CUDA_DOWNLOAD_URL%/cudart-llama-bin-win-cu11.7-x64.tar.gz -e --strip 1 -o %BIN_PATH%
move %BIN_PATH%cortex-server-beta.exe %BIN_PATH%cortex-server.exe
copy %BIN_PATH%cortex-server.exe %BIN_PATH%cortex-server-x86_64-pc-windows-msvc.exe

View File

@ -629,26 +629,26 @@ Section Install
File "${MAINBINARYSRCPATH}"
; Copy resources
CreateDirectory "$INSTDIR\resources\themes\joi-light"
CreateDirectory "$INSTDIR\resources\pre-install"
CreateDirectory "$INSTDIR\resources\themes\night-blue"
CreateDirectory "$INSTDIR\resources\themes\joi-dark"
CreateDirectory "$INSTDIR\binaries"
CreateDirectory "$INSTDIR\resources\themes\dark-dimmed"
CreateDirectory "$INSTDIR\resources"
SetOutPath "$INSTDIR\binaries"
File /nonfatal /a /r "D:\a\jan\jan\src-tauri\binaries\engines\"
SetOutPath $INSTDIR
File /r "D:\a\jan\jan\src-tauri\binaries\*.dll"
File /a "/oname=resources\pre-install\janhq-assistant-extension-1.0.2.tgz" "D:\a\jan\jan\src-tauri\resources\pre-install\janhq-assistant-extension-1.0.2.tgz"
File /a "/oname=resources\pre-install\janhq-conversational-extension-1.0.0.tgz" "D:\a\jan\jan\src-tauri\resources\pre-install\janhq-conversational-extension-1.0.0.tgz"
File /a "/oname=resources\pre-install\janhq-engine-management-extension-1.0.3.tgz" "D:\a\jan\jan\src-tauri\resources\pre-install\janhq-engine-management-extension-1.0.3.tgz"
File /a "/oname=resources\pre-install\janhq-hardware-management-extension-1.0.0.tgz" "D:\a\jan\jan\src-tauri\resources\pre-install\janhq-hardware-management-extension-1.0.0.tgz"
File /a "/oname=resources\pre-install\janhq-inference-cortex-extension-1.0.25.tgz" "D:\a\jan\jan\src-tauri\resources\pre-install\janhq-inference-cortex-extension-1.0.25.tgz"
File /a "/oname=resources\pre-install\janhq-model-extension-1.0.36.tgz" "D:\a\jan\jan\src-tauri\resources\pre-install\janhq-model-extension-1.0.36.tgz"
File /a "/oname=resources\themes\dark-dimmed\theme.json" "D:\a\jan\jan\src-tauri\resources\themes\dark-dimmed\theme.json"
File /a "/oname=resources\themes\joi-dark\theme.json" "D:\a\jan\jan\src-tauri\resources\themes\joi-dark\theme.json"
File /a "/oname=resources\themes\joi-light\theme.json" "D:\a\jan\jan\src-tauri\resources\themes\joi-light\theme.json"
File /a "/oname=resources\themes\night-blue\theme.json" "D:\a\jan\jan\src-tauri\resources\themes\night-blue\theme.json"
; File /a "/oname=cublas64_11.dll" "D:\a\jan\jan\src-tauri\binaries\cublas64_11.dll"
File /a "/oname=cublas64_12.dll" "D:\a\jan\jan\src-tauri\binaries\cublas64_12.dll"
; File /a "/oname=cublasLt64_11.dll" "D:\a\jan\jan\src-tauri\binaries\cublasLt64_11.dll"
File /a "/oname=cublasLt64_12.dll" "D:\a\jan\jan\src-tauri\binaries\cublasLt64_12.dll"
File /a "/oname=cudart64_12.dll" "D:\a\jan\jan\src-tauri\binaries\cudart64_12.dll"
; File /a "/oname=cudart64_110.dll" "D:\a\jan\jan\src-tauri\binaries\cudart64_110.dll"
File /a "/oname=msvcp140.dll" "D:\a\jan\jan\src-tauri\binaries\msvcp140.dll"
; File /a "/oname=vcomp140.dll" "D:\a\jan\jan\src-tauri\binaries\vcomp140.dll"
File /a "/oname=vcruntime140_1.dll" "D:\a\jan\jan\src-tauri\binaries\vcruntime140_1.dll"
File /a "/oname=vcruntime140.dll" "D:\a\jan\jan\src-tauri\binaries\vcruntime140.dll"
File /a "/oname=vulkan-1.dll" "D:\a\jan\jan\src-tauri\binaries\vulkan-1.dll"
SetOutPath "$INSTDIR\resources"
File /nonfatal /a /r "D:\a\jan\jan\src-tauri\resources\pre-install\"
File /nonfatal /a /r "D:\a\jan\jan\src-tauri\resources\themes\"
SetOutPath $INSTDIR
; Copy external binaries
File /a "/oname=cortex-server.exe" "D:\a\jan\jan\src-tauri\binaries\cortex-server-x86_64-pc-windows-msvc.exe"
@ -803,8 +803,8 @@ Section Uninstall
RMDir /REBOOTOK "$INSTDIR\resources\pre-install"
RMDir /REBOOTOK "$INSTDIR\resources\themes"
RMDir /r /REBOOTOK "$INSTDIR\binaries"
RMDir /REBOOTOK "$INSTDIR\resources"
RMDir "$INSTDIR"
RMDir /r /REBOOTOK "$INSTDIR\resources"
RMDir /r "$INSTDIR"
; Remove shortcuts if not updating
${If} $UpdateMode <> 1
@ -961,4 +961,4 @@ Function CreateOrUpdateDesktopShortcut
CreateShortcut "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
!insertmacro SetLnkAppUserModelId "$DESKTOP\${PRODUCTNAME}.lnk"
FunctionEnd
FunctionEnd

View File

@ -12,8 +12,10 @@ import { IconCirclePlus } from '@tabler/icons-react'
import type { Assistant } from '@/hooks/useAssistant'
const DropdownAssistant = () => {
// @ts-ignore
const { assistants, addAssistant, updateAssistant } = useAssistant()
const [open, setOpen] = useState(false)
// @ts-ignore
const [editingKey, setEditingKey] = useState<string | null>(null)
const handleSave = (assistant: Assistant) => {

View File

@ -20,6 +20,7 @@ export default function LanguageSwitcher() {
const changeLanguage = (lng: string) => {
i18n.changeLanguage(lng)
// @ts-ignore
setCurrentLanguage(lng as Language)
}

View File

@ -41,6 +41,7 @@ export function ModelSetting({ model, provider }: ModelSettingProps) {
[key]: {
...(model.settings?.[key] != null ? model.settings?.[key] : {}),
controller_props: {
// @ts-ignore
...(model.settings?.[key]?.controller_props ?? {}),
value: value,
},
@ -66,6 +67,7 @@ export function ModelSetting({ model, provider }: ModelSettingProps) {
updateModel({
id: model.id,
settings: Object.entries(updatedModel.settings).map(([key, value]) => ({
// @ts-ignore
[key]: value.controller_props?.value,
})) as ModelSettingParams,
})

View File

@ -3,9 +3,11 @@ import { persist, createJSONStorage } from 'zustand/middleware'
import { localStoregeKey } from '@/constants/localStorage'
type LeftPanelStoreState = {
// @ts-ignore
currentLanguage: Language
spellCheckChatInput: boolean
setSpellCheckChatInput: (value: boolean) => void
// @ts-ignore
setCurrentLanguage: (value: Language) => void
}

View File

@ -274,7 +274,7 @@ export const postMessageProcessing = async (
? JSON.parse(toolCall.function.arguments)
: {},
})
// @ts-ignore
if (result.error) break
message.metadata = {
@ -291,7 +291,7 @@ export const postMessageProcessing = async (
},
],
}
// @ts-ignore
builder.addToolMessage(result.content[0]?.text ?? '', toolCall.id)
// update message metadata
return message