mirror of
https://github.com/ValueCell-ai/ClawX.git
synced 2026-08-14 00:48:10 +00:00
17 lines
554 B
TypeScript
17 lines
554 B
TypeScript
import type { CompleteHostServiceRegistry } from '../main/ipc/host-contract';
|
|
import { runOpenClawDoctor, runOpenClawDoctorFix } from '../utils/openclaw-doctor';
|
|
import { isRecord } from './payload-utils';
|
|
|
|
type OpenClawDoctorPayload = {
|
|
mode?: unknown;
|
|
};
|
|
|
|
export function createAppApi(): CompleteHostServiceRegistry['app'] {
|
|
return {
|
|
openClawDoctor: async (payload) => {
|
|
const body = isRecord(payload) ? payload as OpenClawDoctorPayload : {};
|
|
return body.mode === 'fix' ? runOpenClawDoctorFix() : runOpenClawDoctor();
|
|
},
|
|
};
|
|
}
|