Split the flat 134-method DesktopApi interface into 12 domain sub-interfaces (companies, agents, tasks, runs, approvals, communication, threads, credentials, skills, budget, automation, window) under src/shared/contracts/desktop-api/. desktop-api.ts now intersects them to preserve the exact external flat shape; window.agentCompany consumers and preload wiring are untouched.
13 lines
732 B
TypeScript
13 lines
732 B
TypeScript
import type { z } from "zod";
|
|
import type { ApprovalRecord } from "../../types";
|
|
import type { approvalDecisionSchema, approvalInputSchema } from "../schemas-approvals";
|
|
import type { deleteEntitySchema, entityGetterSchema } from "../schemas-badges";
|
|
import type { DesktopResult } from "./common";
|
|
|
|
export type ApprovalsApi = {
|
|
requestApproval: (input: z.infer<typeof approvalInputSchema>) => Promise<DesktopResult<string>>;
|
|
decideApproval: (input: z.infer<typeof approvalDecisionSchema>) => Promise<DesktopResult<boolean>>;
|
|
deleteApproval: (input: z.infer<typeof deleteEntitySchema>) => Promise<DesktopResult<boolean>>;
|
|
getApproval: (input: z.infer<typeof entityGetterSchema>) => Promise<DesktopResult<ApprovalRecord>>;
|
|
};
|