Files
AgentCompany/src/shared/contracts/desktop-api/approvals.ts
T
ZacharyZhang-NY 5f147e0b9a refactor(contracts): compose DesktopApi from per-domain sub-interfaces
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.
2026-04-16 23:28:08 -04:00

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>>;
};