feat(sync): type SyncJobInfo + sync_status; extend sync://job event type (T9.5)

This commit is contained in:
iamdoubz committed 2026-07-03 07:42:02 -05:00
1 parent 906c800b2a
commit e1893daee2
1 file changed
+18 -2
+18 -2
View File
@@ -233,6 +233,20 @@ export interface SyncTargetConfig {
encrypt_before_upload?: boolean;
}
// A durable upload job for one artifact × target (sync_status). Snake_case,
// matching the Rust SyncJobInfo; the sync://job *event* is camelCase (onSyncJob).
export interface SyncJobInfo {
id: string;
target_id: string;
meeting_id: MeetingId;
artifact: string;
status: string; // pending|uploading|done|failed|skipped
attempts: number;
bytes_sent: number;
bytes_total: number | null;
last_error: string | null;
}
export interface AppSettings {
theme: string;
storage_root: string;
@@ -383,7 +397,7 @@ export const api = {
invoke<{ ok: boolean; account?: string }>("begin_oauth_link", { kind }),
syncMeeting: (meetingId: MeetingId, targetId?: string) =>
invoke<void>("sync_meeting", { meetingId, targetId }),
syncStatus: (meetingId?: MeetingId) => invoke("sync_status", { meetingId }),
syncStatus: (meetingId?: MeetingId) => invoke<SyncJobInfo[]>("sync_status", { meetingId }),
retrySyncJob: (jobId: string) => invoke<void>("retry_sync_job", { jobId }),
// Feature briefs + MCP server (ADR-0011). MCP server is loopback-only and off by default.
@@ -461,7 +475,9 @@ export const events = {
artifact: string;
status: string;
bytesSent: number;
bytesTotal: number;
bytesTotal: number | null;
attempts?: number;
error?: string | null;
}) => void,
): Promise<UnlistenFn> => listen("sync://job", (e) => cb(e.payload as never)),
onMcpAccess: (cb: (p: McpAccessEntry & { client?: string }) => void): Promise<UnlistenFn> =>