feat: add approved modpack sync and StarLight instance modes
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled

This commit is contained in:
2026-09-14 22:59:16 +08:00
parent 5d181ed8cc
commit 171a19985b
29 changed files with 1891 additions and 225 deletions

View File

@ -0,0 +1,33 @@
import { invoke } from '@tauri-apps/api/core'
export type InstanceMode = 'starlight' | 'local'
export const getInstanceMode = (instanceId: string) =>
invoke<InstanceMode>('plugin:install|hosted_instance_mode', { instanceId })
export const setInstanceMode = (instanceId: string, mode: InstanceMode) =>
invoke<void>('plugin:install|hosted_set_instance_mode', { instanceId, mode })
export interface HostedPublication {
packId: string
releaseId: number
manifest: {
name: string
version: string
format: string
runtime: { gameVersion: string; loader: string; loaderVersion: string | null }
files: { path: string; size: number; sha256: string }[]
}
}
export interface HostedBinding {
publication: HostedPublication
}
export interface HostedSyncResult {
version: string
downloadedBytes: number
changedFiles: number
preservedFiles: string[]
}
export const hostedCatalog = () => invoke<HostedPublication[]>('plugin:install|hosted_catalog')
export const hostedBinding = (instanceId: string) =>
invoke<HostedBinding | null>('plugin:install|hosted_binding', { instanceId })
export const hostedSync = (instanceId: string, packId: string) =>
invoke<HostedSyncResult>('plugin:install|hosted_sync', { instanceId, packId })

View File

@ -32,6 +32,7 @@ export interface InstallModpackPreview {
}
export interface InstallCreateInstanceRequest {
instanceMode?: 'starlight' | 'local'
name: string
gameVersion: string
loader: InstanceLoader