mirror of
https://github.com/stablyai/orca.git
synced 2026-10-29 16:17:51 +00:00
29 lines
822 B
TypeScript
29 lines
822 B
TypeScript
import type { IpcMainInvokeEvent } from 'electron'
|
|
import type { SkillBundleInstallProgress } from '../../shared/skill-bundle-install-contract'
|
|
import type { SkillInstallProgress } from '../../shared/skill-sharing-contract'
|
|
|
|
export function sendSkillInstallProgress(
|
|
event: IpcMainInvokeEvent,
|
|
progress: SkillInstallProgress
|
|
): void {
|
|
if (!event.sender.isDestroyed()) {
|
|
event.sender.send('skills:installProgress', progress)
|
|
}
|
|
}
|
|
|
|
export function sendBundleInstallProgress(
|
|
event: IpcMainInvokeEvent,
|
|
progress: SkillBundleInstallProgress
|
|
): void {
|
|
sendSkillInstallProgress(event, {
|
|
operationId: progress.operationId,
|
|
phase: 'installing',
|
|
currentSkill: {
|
|
id: progress.skillId,
|
|
name: progress.skillName,
|
|
index: progress.skillIndex,
|
|
total: progress.skillCount
|
|
}
|
|
})
|
|
}
|