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.
This commit is contained in:
1 parent
0f881097bc
commit
5f147e0b9a
14 files changed
+319
-283
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import type { z } from "zod";
|
||||
import type { BudgetIncidentRecord, BudgetPolicyRecord, BudgetStatusSummary } from "../../types";
|
||||
import type { budgetPolicyInputSchema, deleteBudgetPolicySchema, listBudgetIncidentsSchema, resolveBudgetIncidentSchema } from "../schemas-budget";
|
||||
import type { DesktopResult } from "./common";
|
||||
|
||||
export type BudgetApi = {
|
||||
saveBudgetPolicy: (input: z.infer<typeof budgetPolicyInputSchema>) => Promise<DesktopResult<string>>;
|
||||
deleteBudgetPolicy: (input: z.infer<typeof deleteBudgetPolicySchema>) => Promise<DesktopResult<boolean>>;
|
||||
listBudgetPolicies: (companyId: string) => Promise<DesktopResult<BudgetPolicyRecord[]>>;
|
||||
listBudgetIncidents: (input: z.infer<typeof listBudgetIncidentsSchema>) => Promise<DesktopResult<BudgetIncidentRecord[]>>;
|
||||
resolveBudgetIncident: (input: z.infer<typeof resolveBudgetIncidentSchema>) => Promise<DesktopResult<boolean>>;
|
||||
getBudgetStatus: (companyId: string) => Promise<DesktopResult<BudgetStatusSummary>>;
|
||||
};
|
||||
Reference in new issue
Block a user